Maybe the language should be changed to allow Iterator to be changed to have a signature like this: pub trait Iterator<A> { fn next<'a>(&'a mut self) -> Option<'a A>; }
Then you could return the &mut by reborrowing and would be able to advance the iterator without issue afterwards. _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev