Created
September 14, 2018 09:10
-
-
Save mykhailokrainik/edd7131ba98fa2905044d61e130bc009 to your computer and use it in GitHub Desktop.
impl Iterator<Item = T>
This file contains hidden or 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
fn iterate<T>(data: Vec<T>) -> impl Iterator<Item = T> { | |
data.into_iter() | |
} | |
fn main() { | |
for x in iterate(vec!["1", "2", "3"]) { | |
println!("Hi! {}", x); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment