Last active
August 29, 2015 14:07
-
-
Save emk/1162120f16432e12b10f to your computer and use it in GitHub Desktop.
Make this work, and StreamingIterator will be able to do a lot.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait Nothing<'a> { | |
fn nothing(&'a mut self) -> (); | |
fn twice_nothing(&'a mut self) -> () { | |
{ self.nothing(); } | |
{ self.nothing(); } | |
} | |
} | |
// This works. | |
pub trait Nothing2 { | |
fn nothing(&mut self) -> (); | |
fn twice_nothing(&mut self) -> () { | |
{ self.nothing(); } | |
{ self.nothing(); } | |
} | |
} | |
// Here's the actual type we're working with. This was found via much trial and error. | |
pub trait StreamingIterator<'a, T> { | |
/// Return either the next item in the sequence, or `None` if all items | |
/// have been consumed. | |
fn next(&'a mut self) -> Option<T>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment