1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-11-27 16:28:48 +02:00

docs: improve language in std-traits section (#2872)

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
This commit is contained in:
Martin Geisler
2025-09-06 19:09:29 +02:00
committed by GitHub
parent 27a5836a94
commit 2679581811
2 changed files with 5 additions and 5 deletions

View File

@@ -4,7 +4,7 @@
<details>
As with the standard-library types, spend time reviewing the documentation for
As with the standard library types, spend time reviewing the documentation for
each trait.
This section is long. Take a break midway through.

View File

@@ -44,10 +44,10 @@ Discussion points:
- You could implement `Add` for two different types, e.g.
`impl Add<(i32, i32)> for Point` would add a tuple to a `Point`.
The `Not` trait (`!` operator) is notable because it does not "boolify" like the
same operator in C-family languages; instead, for integer types it negates each
bit of the number, which arithmetically is equivalent to subtracting it from -1:
`!5 == -6`.
The `Not` trait (`!` operator) is notable because it does not convert the
argument to `bool` like the same operator in C-family languages; instead, for
integer types it flips each bit of the number, which, arithmetically, is
equivalent to subtracting the argument from `-1`: `!5 == -6`.
</details>