copying and owners
This commit is contained in:
parent
ecf2317a5b
commit
ba8a489a3b
12
src/main.rs
12
src/main.rs
|
@ -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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue