mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-02-23 04:32:16 +08:00
更新listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs
This commit is contained in:
parent
dd8c1bb414
commit
7cea50d3cd
@ -6,8 +6,8 @@ struct Rectangle {
|
|||||||
|
|
||||||
// ANCHOR: here
|
// ANCHOR: here
|
||||||
impl Rectangle {
|
impl Rectangle {
|
||||||
fn square(size: u32) -> Rectangle {
|
fn square(size: u32) -> Self {
|
||||||
Rectangle {
|
Self {
|
||||||
width: size,
|
width: size,
|
||||||
height: 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/
|
@ -0,0 +1 @@
|
|||||||
|
This file has an mtime of when this was started.
|
@ -0,0 +1 @@
|
|||||||
|
This file has an mtime of when this was started.
|
Loading…
Reference in New Issue
Block a user