mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-02-22 20:22:18 +08:00
update ch05-03-method-syntax.md
This commit is contained in:
parent
1dede971a8
commit
be7fd7ec2c
@ -112,7 +112,7 @@ Can rect1 hold rect3? false
|
||||
{{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs:here}}
|
||||
```
|
||||
|
||||
使用结构体名和 `::` 语法来调用这个关联函数:比如 `let sq = Rectangle::square(3);`。这个方法位于结构体的命名空间中:`::` 语法用于关联函数和模块创建的命名空间。第七章会讲到模块。
|
||||
使用结构体名和 `::` 语法来调用这个关联函数:比如 `let sq = Rectangle::square(3);`。这个函数位于结构体的命名空间中:`::` 语法用于关联函数和模块创建的命名空间。第七章会讲到模块。
|
||||
|
||||
### 多个 `impl` 块
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user