Solve more move exercises (#5)

This commit is contained in:
Jonathan Zernik 2022-06-06 23:37:10 -07:00 committed by GitHub
parent 5ee9780355
commit 52f25a7b62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View File

@ -4,8 +4,6 @@
// freshly created vector from fill_vec to its caller.
// Execute `rustlings hint move_semantics4` for hints!
// I AM NOT DONE
fn main() {
// let vec0 = Vec::new();

View File

@ -3,13 +3,11 @@
// adding, changing or removing any of them.
// Execute `rustlings hint move_semantics5` for hints :)
// I AM NOT DONE
fn main() {
let mut x = 100;
let y = &mut x;
let z = &mut x;
*y += 100;
let z = &mut x;
*z += 1000;
assert_eq!(x, 1200);
}