From 7cea50d3cd040d2fa2a85cf34a8c5262eb897af8 Mon Sep 17 00:00:00 2001 From: Xuzheng77s Date: Fri, 19 Aug 2022 19:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0listings/ch05-using-structs-t?= =?UTF-8?q?o-structure-related-data/no-listing-03-associated-functions/src?= =?UTF-8?q?/main.rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../no-listing-03-associated-functions/src/main.rs | 4 ++-- .../no-listing-03-associated-functions/target/CACHEDIR.TAG | 3 +++ .../target/rls/CACHEDIR.TAG | 3 +++ .../target/rls/debug/.cargo-lock | 0 .../rectangles-6066a8348ac7f40b/invoked.timestamp | 1 + .../rectangles-937cd89110303d07/invoked.timestamp | 1 + .../rectangles-2as79s7g9rucu/s-gcqq22m2rv-kx4l9d.lock | 0 7 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/CACHEDIR.TAG create mode 100644 listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/CACHEDIR.TAG create mode 100644 listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.cargo-lock create mode 100644 listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.fingerprint/rectangles-6066a8348ac7f40b/invoked.timestamp create mode 100644 listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.fingerprint/rectangles-937cd89110303d07/invoked.timestamp create mode 100644 listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/incremental/rectangles-2as79s7g9rucu/s-gcqq22m2rv-kx4l9d.lock diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs index d5b1692..47fedc5 100755 --- a/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs @@ -6,8 +6,8 @@ struct Rectangle { // ANCHOR: here impl Rectangle { - fn square(size: u32) -> Rectangle { - Rectangle { + fn square(size: u32) -> Self { + Self { width: size, height: size, } diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/CACHEDIR.TAG b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/CACHEDIR.TAG new file mode 100644 index 0000000..20d7c31 --- /dev/null +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/CACHEDIR.TAG @@ -0,0 +1,3 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by cargo. +# For information about cache directory tags see https://bford.info/cachedir/ diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/CACHEDIR.TAG b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/CACHEDIR.TAG new file mode 100644 index 0000000..20d7c31 --- /dev/null +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/CACHEDIR.TAG @@ -0,0 +1,3 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by cargo. +# For information about cache directory tags see https://bford.info/cachedir/ diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.cargo-lock b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.cargo-lock new file mode 100644 index 0000000..e69de29 diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.fingerprint/rectangles-6066a8348ac7f40b/invoked.timestamp b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.fingerprint/rectangles-6066a8348ac7f40b/invoked.timestamp new file mode 100644 index 0000000..e00328d --- /dev/null +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.fingerprint/rectangles-6066a8348ac7f40b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.fingerprint/rectangles-937cd89110303d07/invoked.timestamp b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.fingerprint/rectangles-937cd89110303d07/invoked.timestamp new file mode 100644 index 0000000..e00328d --- /dev/null +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/.fingerprint/rectangles-937cd89110303d07/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/incremental/rectangles-2as79s7g9rucu/s-gcqq22m2rv-kx4l9d.lock b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/target/rls/debug/incremental/rectangles-2as79s7g9rucu/s-gcqq22m2rv-kx4l9d.lock new file mode 100644 index 0000000..e69de29