Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn take_vec<T>(_v: Vec<T>) {} // requires a Vec
- fn main() {
- // collect returns any kind of collection
- let x = [1, 2, 3].into_iter().collect();
- take_vec(x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement