diff options
Diffstat (limited to 'rust/theBook/chapter-4-understanding-ownership/emp1.rs')
-rw-r--r-- | rust/theBook/chapter-4-understanding-ownership/emp1.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rust/theBook/chapter-4-understanding-ownership/emp1.rs b/rust/theBook/chapter-4-understanding-ownership/emp1.rs new file mode 100644 index 0000000..a0f4bbd --- /dev/null +++ b/rust/theBook/chapter-4-understanding-ownership/emp1.rs @@ -0,0 +1,9 @@ +fn main() { + let mut s = String::from("hello"); + + let r1 = &s; + let r2 = &s; + println!("{},{}",r1,r2); + let r3 = &mut s; + println!("{r3}"); +} |