Playing with stack and heap copying
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
|
let x = 5;
|
||||||
|
let y = x;
|
||||||
|
|
||||||
|
println!("x = {}, y = {}", x, y);
|
||||||
|
|
||||||
let s1 = String::from("hello");
|
let s1 = String::from("hello");
|
||||||
let s2 = s1.clone();
|
let s2 = s1.clone();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user