X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/4f61be32dd480f23a7fef05ee66c42ae27c980c6..f212d116773ee38f4e8a6b18c3aaa3869472de7b:/workspace/src/part04.rs?ds=sidebyside diff --git a/workspace/src/part04.rs b/workspace/src/part04.rs index fb23f29..c7969ac 100644 --- a/workspace/src/part04.rs +++ b/workspace/src/part04.rs @@ -1,5 +1,3 @@ -// ***Remember to enable/add this part in `main.rs`!*** - // Rust-101, Part 04: Ownership, Borrowing // ======================================= @@ -16,7 +14,7 @@ fn work_on_vector(v: Vec) { /* do something */ } fn ownership_demo() { let v = vec![1,2,3,4]; work_on_vector(v); - /* println!("The first element is: {}", v[0]); */ + /* println!("The first element is: {}", v[0]); */ /* BAD! */ } // ## Shared borrowing @@ -57,7 +55,7 @@ fn mutable_borrow_demo() { /* let first = &v[0]; */ vec_inc(&mut v); vec_inc(&mut v); - /* println!("The first element is: {}", *first); */ + /* println!("The first element is: {}", *first); */ /* BAD! */ } // ## Summary