Re:Falling in love with Rust
by gamegoblin on Wednesday September 19, 2018 @03:36AM
(#18022473)
I believe that is written that way because it's using futures. Once async/await lands this year, all of the futures combinator madness goes away.
The code could use closures to split the expression or define local functions on the bottom of the surrounding function (a.k.a Haskell style). This would increase readability a lot.
Example: https://play.rust-lang.org/?gist=7ea1a39971399d0429f0369cb9e...
My suspicion is the people do this to avoid "variable does not live long enough" type errors.