Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Code shared from the Rust Playground
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