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) {
println!("{}", name);
}
#[derive(Clone, Debug)]
struct Point(i32, i32);
fn main() {
let name = String::from("alice");
say_hello(&name);
say_hello(&name);
let p1 = Point(3, 4);
let p2 = p1.clone();
println!("p1: {p1:?}");
println!("p2: {p2:?}");
}

Binary file not shown.