1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-04-26 17:23:01 +02:00

Fix capitalization of Rust (#1007)

This commit is contained in:
Martin Geisler 2023-07-18 12:41:27 +02:00 committed by GitHub
parent b0380e1f0e
commit 94e5db7ddb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ fn main() {
}
```
- While _technically_, rust does not have custom constructors, static methods are commonly used to initialize structs (but don't have to).
- While _technically_, Rust does not have custom constructors, static methods are commonly used to initialize structs (but don't have to).
The actual constructor, `Rectangle { width, height }`, could be called directly. See the [Rustnomicon](https://doc.rust-lang.org/nomicon/constructors.html).
- Add a `Rectangle::new_square(width: u32)` constructor to illustrate that such static methods can take arbitrary parameters.