summaryrefslogtreecommitdiff
path: root/exercises/06_move_semantics/move_semantics4.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-07-10 13:50:39 +0200
committermo8it <mo8it@proton.me>2024-07-10 13:50:39 +0200
commitd7024d80ce0a640271d006dbfda440f60652af6d (patch)
tree40f94707570c03d7adcd6065f4a82603bb26c8d8 /exercises/06_move_semantics/move_semantics4.rs
parent59d6b852afd81385020f2b59ab95c85af6229763 (diff)
move_semantics4: Avoid using the dereference operator
Diffstat (limited to 'exercises/06_move_semantics/move_semantics4.rs')
-rw-r--r--exercises/06_move_semantics/move_semantics4.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/exercises/06_move_semantics/move_semantics4.rs b/exercises/06_move_semantics/move_semantics4.rs
index 83a0344..56da988 100644
--- a/exercises/06_move_semantics/move_semantics4.rs
+++ b/exercises/06_move_semantics/move_semantics4.rs
@@ -8,11 +8,11 @@ mod tests {
// Don't add, change or remove any line.
#[test]
fn move_semantics4() {
- let mut x = 100;
+ let mut x = Vec::new();
let y = &mut x;
let z = &mut x;
- *y += 100;
- *z += 1000;
- assert_eq!(x, 1200);
+ y.push(42);
+ z.push(13);
+ assert_eq!(x, [42, 13]);
}
}