1
0
mirror of https://github.com/KaiserY/trpl-zh-cn synced 2025-04-08 05:08:07 +08:00

更新listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs

This commit is contained in:
Xuzheng77s 2022-08-19 19:01:53 +08:00
parent dd8c1bb414
commit 7cea50d3cd
7 changed files with 10 additions and 2 deletions
listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions
src
target
CACHEDIR.TAG
rls
CACHEDIR.TAG
debug
.cargo-lock
.fingerprint
rectangles-6066a8348ac7f40b
rectangles-937cd89110303d07
incremental/rectangles-2as79s7g9rucu

View File

@ -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,
}

View File

@ -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/

View File

@ -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/