Created
June 7, 2020 13:19
-
-
Save fengjian/7ac87efdb2723d88b2d167012a97dd4c 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
fn process<I, T>(container: I) | |
where | |
T: std::fmt::Display, | |
I: IntoIterator<Item=T> | |
{ | |
for data in container { | |
println!("{}", data); | |
} | |
} | |
fn main() { | |
let v = vec![1,2,3]; | |
process(&v); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fn process<I, T>(container: &I)
编译不过去。。