News for hackers. Stuff that matters.
Re:Zero-cost futures in Rust by Ygg2 on Thursday August 11, 2016 @01:06PM (#12269928)
Rust couldn't return Traits since they vary in return Size.So using couple of chain and maps would result in following syntax.

    fn did_too_many_chains() -> Chain<Map<'a, (int, u8), u16, Enumerate<Filter<'a, u8, vec::MoveItems<u8>>>>, SkipWhile<'a, u16, Map<'a, &u16, u16, slice::Items<u16>>>>
Now, you can write:

   fn did_too_many_chains() -> impl Iterator 
and be done with it.
Re:Zero-cost futures in Rust by fnord123 on Friday August 12, 2016 @05:45AM (#12274322)
That's awesome. I've been banging my head against the wall trying to implement a Drain iterator for a tree structure and it tries to recurse. I ended up with things like your Chain<Map...>> and was banging my head against the wall over it.