update ch05-03-method-syntax.md

This commit is contained in:
shinolr 2022-07-01 10:43:28 +08:00
parent 1dede971a8
commit be7fd7ec2c

View File

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