diff options
| author | anand <anand.panchdhari@gmail.com> | 2025-11-19 14:35:50 +0530 |
|---|---|---|
| committer | anand <anand.panchdhari@gmail.com> | 2025-11-19 14:35:50 +0530 |
| commit | f8d94cce2a21067d666f65d23d591f0f40cf6c36 (patch) | |
| tree | 773c005674c1b21e3ef68a39feabb87aa2eaa305 /exercises/06_move_semantics/move_semantics4.rs | |
| parent | 8597b29e143cdeae50eafae06e0d8ed900b25295 (diff) | |
Finished vecs and move semantics
Diffstat (limited to 'exercises/06_move_semantics/move_semantics4.rs')
| -rw-r--r-- | exercises/06_move_semantics/move_semantics4.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/exercises/06_move_semantics/move_semantics4.rs b/exercises/06_move_semantics/move_semantics4.rs index 56da988..3e0672c 100644 --- a/exercises/06_move_semantics/move_semantics4.rs +++ b/exercises/06_move_semantics/move_semantics4.rs @@ -9,9 +9,11 @@ mod tests { #[test] fn move_semantics4() { let mut x = Vec::new(); - let y = &mut x; + { + let y = &mut x; + y.push(42); + } let z = &mut x; - y.push(42); z.push(13); assert_eq!(x, [42, 13]); } |
