Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let v = vec![1, 2, 3];
- // v is moved into do_nothing
- do_nothing(v);
- // Error when accessing v
- println!("{}", v[1]);
- }
- fn do_nothing(v: Vec<i32>) {
- // Do nothing here.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement