Created
March 20, 2014 20:59
-
-
Save erickt/9673666 to your computer and use it in GitHub Desktop.
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
trait IntoIterator<T, Iter: Iterator<T>> { | |
fn into_iterator(self) -> Iter; | |
} | |
impl<T, Iter: Iterator<T>> IntoIterator<T, Iter> for Iter { | |
fn into_iterator(self) -> Iter { | |
self | |
} | |
} | |
trait MoveIterable<T, Iter: Iterator<T>> { | |
fn move_iter(self) -> Iter; | |
} | |
impl<T, Iter: Iterator<T>, It: MoveIterable<T, Iter>> IntoIterator<T, Iter> for It { | |
fn into_iterator(self) -> Iter { | |
self.move_iter() | |
} | |
} | |
fn main() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment