1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-27 19:18:59 +02:00

Fix unclear wording in default.md (#915)

This commit is contained in:
Martin Geisler
2023-07-06 16:25:16 +02:00
committed by GitHub
parent b573caad05
commit 02359573a4

View File

@ -38,7 +38,7 @@ fn main() {
<details> <details>
* It can be implemented directly or it can be derived via `#[derive(Default)]`. * It can be implemented directly or it can be derived via `#[derive(Default)]`.
* Derived implementation will produce an instance where all fields are set to their default values. * A derived implementation will produce a value where all fields are set to their default values.
* This means all types in the struct must implement `Default` too. * This means all types in the struct must implement `Default` too.
* Standard Rust types often implement `Default` with reasonable values (e.g. `0`, `""`, etc). * Standard Rust types often implement `Default` with reasonable values (e.g. `0`, `""`, etc).
* The partial struct copy works nicely with default. * The partial struct copy works nicely with default.