Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::fmt::Display;
- fn print_iterator<A, B>(iter: A) where A: Iterator<Item=B>, B: Display {
- for thing in iter {
- println!("{}", thing);
- }
- }
- fn main() {
- print_iterator(0..10);
- print_iterator((0..10).rev());
- }
Add Comment
Please, Sign In to add comment