News for hackers. Stuff that matters.
Re:Rust 2019: Tame Complexity through Community Involvement ... by smaddox on Tuesday January 01, 2019 @03:24PM (#18802106)
You should try using `map_err` and the `?` operator, with your own error enum defined using the `failure_derive` crate, for example:

    foo().map_err(|e| MyError::FooError(e))?
      .bar().map_err(|e| MyError::BarError(e))?;
Re:Rust 2019: Tame Complexity through Community Involvement ... by kouteiheika on Tuesday January 01, 2019 @04:42PM (#18802568)
A tip - you usually don't need lambdas in such cases; this should work:

    foo().map_err(MyError::FooError)?
      .bar().map_err(MyError::BarError)?;
Re:Rust 2019: Tame Complexity through Community Involvement ... by smaddox on Tuesday January 01, 2019 @08:56PM (#18803671)
Oh, nice! I did not realize tuple constructors implemented `FnOnce`! Thanks for the tip!
Re:Rust 2019: Tame Complexity through Community Involvement ... by dakom on Tuesday January 01, 2019 @03:51PM (#18802273)
d'oh - you beat me to it ;)