diff options
| author | mo8it <mo8it@proton.me> | 2024-07-03 15:26:35 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-07-03 15:26:35 +0200 |
| commit | f5ce4cf0a50e88e0e70d90e139a6e981791c9af0 (patch) | |
| tree | b908688a611c6e64ff1bb7a6a94e9547b7b575de /exercises/06_move_semantics/move_semantics6.rs | |
| parent | 888ad35d10e8bc6832c11fd8268697311497c1c9 (diff) | |
| parent | ff3e6c05a52aa0c7e558d86404cfe8495a4412fd (diff) | |
Merge branch 'v6'
Diffstat (limited to 'exercises/06_move_semantics/move_semantics6.rs')
| -rw-r--r-- | exercises/06_move_semantics/move_semantics6.rs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/exercises/06_move_semantics/move_semantics6.rs b/exercises/06_move_semantics/move_semantics6.rs deleted file mode 100644 index cace4ca..0000000 --- a/exercises/06_move_semantics/move_semantics6.rs +++ /dev/null @@ -1,28 +0,0 @@ -// move_semantics6.rs -// -// You can't change anything except adding or removing references. -// -// Execute `rustlings hint move_semantics6` or use the `hint` watch subcommand -// for a hint. - -// I AM NOT DONE - -fn main() { - let data = "Rust is great!".to_string(); - - get_char(data); - - string_uppercase(&data); -} - -// Should not take ownership -fn get_char(data: String) -> char { - data.chars().last().unwrap() -} - -// Should take ownership -fn string_uppercase(mut data: &String) { - data = &data.to_uppercase(); - - println!("{}", data); -} |
