Guest User

Untitled

a guest
Jun 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. use std::fmt::Display;
  2.  
  3. fn print_iterator<A, B>(iter: A) where A: Iterator<Item=B>, B: Display {
  4. for thing in iter {
  5. println!("{}", thing);
  6. }
  7. }
  8.  
  9. fn main() {
  10. print_iterator(0..10);
  11. print_iterator((0..10).rev());
  12. }
Add Comment
Please, Sign In to add comment