Created
January 24, 2020 16:26
-
-
Save rust-play/7fc39974980739135253e755b2fa1433 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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
use std::fmt::Display; | |
fn do_things<T>(a: T, b: T) where | |
T: IntoIterator, | |
T::Item: Display { | |
for (e,f) in a.into_iter().zip(b.into_iter()) { | |
println!("{} {}", e, f); | |
} | |
} | |
fn main() { | |
do_things(&[1,2,3], &[4,5,6]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment