mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-07 11:19:18 +00:00
Exercise 29
This commit is contained in:
parent
1b5b56b55b
commit
3795936edd
@ -12,8 +12,10 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let mut x = 100;
|
let mut x = 100;
|
||||||
let y = &mut x;
|
let y = &mut x;
|
||||||
let z = &mut x;
|
|
||||||
*y += 100;
|
*y += 100;
|
||||||
|
|
||||||
|
let z = &mut x;
|
||||||
|
|
||||||
*z += 1000;
|
*z += 1000;
|
||||||
assert_eq!(x, 1200);
|
assert_eq!(x, 1200);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user