copying and owners
This commit is contained in:
parent
ecf2317a5b
commit
ba8a489a3b
33 changed files with 6 additions and 6 deletions
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:?}");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue