Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. fn take_vec<T>(_v: Vec<T>) {} // requires a Vec
  2.  
  3. fn main() {
  4. // collect returns any kind of collection
  5. let x = [1, 2, 3].into_iter().collect();
  6. take_vec(x);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement