summaryrefslogtreecommitdiff
path: root/solutions/06_move_semantics
diff options
context:
space:
mode:
Diffstat (limited to 'solutions/06_move_semantics')
-rw-r--r--solutions/06_move_semantics/move_semantics5.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/solutions/06_move_semantics/move_semantics5.rs b/solutions/06_move_semantics/move_semantics5.rs
index 678ec97..1410e91 100644
--- a/solutions/06_move_semantics/move_semantics5.rs
+++ b/solutions/06_move_semantics/move_semantics5.rs
@@ -1,13 +1,5 @@
#![allow(clippy::ptr_arg)]
-fn main() {
- let data = "Rust is great!".to_string();
-
- get_char(&data);
-
- string_uppercase(data);
-}
-
// Borrows instead of taking ownership.
// It is recommended to use `&str` instead of `&String` here. But this is
// enough for now because we didn't handle strings yet.
@@ -21,3 +13,11 @@ fn string_uppercase(mut data: String) {
println!("{data}");
}
+
+fn main() {
+ let data = "Rust is great!".to_string();
+
+ get_char(&data);
+
+ string_uppercase(data);
+}