From 64d95837e9813541cf5b357de13865ce687ae98d Mon Sep 17 00:00:00 2001 From: Adam Brewer Date: Mon, 16 Oct 2023 07:37:12 -0400 Subject: Update Exercises Directory Names to Reflect Order --- exercises/06_move_semantics/move_semantics5.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 exercises/06_move_semantics/move_semantics5.rs (limited to 'exercises/06_move_semantics/move_semantics5.rs') diff --git a/exercises/06_move_semantics/move_semantics5.rs b/exercises/06_move_semantics/move_semantics5.rs new file mode 100644 index 0000000..267bdcc --- /dev/null +++ b/exercises/06_move_semantics/move_semantics5.rs @@ -0,0 +1,19 @@ +// move_semantics5.rs +// +// Make me compile only by reordering the lines in `main()`, but without adding, +// changing or removing any of them. +// +// Execute `rustlings hint move_semantics5` or use the `hint` watch subcommand +// for a hint. + +// I AM NOT DONE + +#[test] +fn main() { + let mut x = 100; + let y = &mut x; + let z = &mut x; + *y += 100; + *z += 1000; + assert_eq!(x, 1200); +} -- cgit v1.2.3