copying and owners

This commit is contained in:
Vincent Batts 2023-01-17 15:01:07 -05:00
parent ecf2317a5b
commit ba8a489a3b
33 changed files with 6 additions and 6 deletions

View file

@ -1,9 +1,9 @@
fn say_hello(name: &str) { #[derive(Clone, Debug)]
println!("{}", name); struct Point(i32, i32);
}
fn main() { fn main() {
let name = String::from("alice"); let p1 = Point(3, 4);
say_hello(&name); let p2 = p1.clone();
say_hello(&name); println!("p1: {p1:?}");
println!("p2: {p2:?}");
} }

Binary file not shown.