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

pull/637/head
Xuzheng77s 2 years ago
parent dd8c1bb414
commit 7cea50d3cd

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

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

@ -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/
Loading…
Cancel
Save