diff --git a/src/main.rs b/src/main.rs index bcb9c01..da12fe1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,13 @@ -#[derive(Clone, Debug)] +#[derive(Debug)] struct Point(i32, i32); +fn add(p1: &Point, p2: &Point) -> Point { + return Point(p1.0 + p2.0, p1.1 + p2.1); +} + fn main() { let p1 = Point(3, 4); - let p2 = p1.clone(); - println!("p1: {p1:?}"); - println!("p2: {p2:?}"); + let p2 = Point(10, 20); + let p3 = add(&p1, &p2); + println!("{p1:?} + {p2:?} = {p3:?}"); } diff --git a/target/debug/basics00 b/target/debug/basics00 index f197129..be40946 100755 Binary files a/target/debug/basics00 and b/target/debug/basics00 differ diff --git a/target/debug/deps/basics00-837a95fe33c7c079 b/target/debug/deps/basics00-837a95fe33c7c079 index f197129..be40946 100755 Binary files a/target/debug/deps/basics00-837a95fe33c7c079 and b/target/debug/deps/basics00-837a95fe33c7c079 differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/1flo4x0vfn957dou.o b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/1flo4x0vfn957dou.o deleted file mode 100644 index fae65f0..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/1flo4x0vfn957dou.o and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/20g1uh68tfrguypa.o b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/20g1uh68tfrguypa.o deleted file mode 100644 index 819c8d5..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/20g1uh68tfrguypa.o and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/220p8y8jth3f7nrz.o b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/220p8y8jth3f7nrz.o deleted file mode 100644 index b0f6650..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/220p8y8jth3f7nrz.o and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/2cumrsybhfasw9r6.o b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/2cumrsybhfasw9r6.o deleted file mode 100644 index c2bc943..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/2cumrsybhfasw9r6.o and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/2oz5c3a1wkrjyhl3.o b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/2oz5c3a1wkrjyhl3.o deleted file mode 100644 index ae50517..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/2oz5c3a1wkrjyhl3.o and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/3ff68b9qa7oq14ky.o b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/3ff68b9qa7oq14ky.o deleted file mode 100644 index aec91d8..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/3ff68b9qa7oq14ky.o and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/4qlgwb3loiguc5oq.o b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/4qlgwb3loiguc5oq.o deleted file mode 100644 index 63c3bd6..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/4qlgwb3loiguc5oq.o and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/dep-graph.bin b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/dep-graph.bin deleted file mode 100644 index ae8879e..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/dep-graph.bin and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/mwaxihrequg68jr.o b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/mwaxihrequg68jr.o deleted file mode 100644 index a7cbdb1..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/mwaxihrequg68jr.o and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/query-cache.bin b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/query-cache.bin deleted file mode 100644 index 43097de..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/query-cache.bin and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/work-products.bin b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/work-products.bin deleted file mode 100644 index 4d44d5d..0000000 Binary files a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty-k551r8aeymjg/work-products.bin and /dev/null differ diff --git a/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty.lock b/target/debug/incremental/basics00-12w982f9njolw/s-ghdmensva6-8q82ty.lock deleted file mode 100644 index e69de29..0000000