mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 21:31:17 -06:00
@@ -209,7 +209,7 @@ impl Rectangle {
|
|||||||
```
|
```
|
||||||
|
|
||||||
To call this associated function, we use the `::` syntax with the struct name:
|
To call this associated function, we use the `::` syntax with the struct name:
|
||||||
`let sq = Rectange::square(3);`, for example. It's kind of this function is
|
`let sq = Rectange::square(3);`, for example. It's kind of like this function is
|
||||||
namespaced by the struct: the `::` syntax is used for both associated functions
|
namespaced by the struct: the `::` syntax is used for both associated functions
|
||||||
and namespaces created by modules, which we'll learn about in Chapter 7.
|
and namespaces created by modules, which we'll learn about in Chapter 7.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user