Skip to content

Commit ca92f70

Browse files
djckornelski
andauthored
Update text/0000-prelude-2021-traits.md
Co-authored-by: Kornel <[email protected]>
1 parent b88bcf0 commit ca92f70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

text/0000-prelude-2021-traits.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ However, it is reasonably common that type inferencing fails to infer the full t
7878
Other traits that have been suggested as prelude candidates:
7979

8080
- `std::ops::Not`: for chaining purposes, it is sometimes useful to have an trailing `.not()` call rather than the prefix `!` operator. Therefore, [it has been suggested](https://internals.rust-lang.org/t/pre-rfc-adding-bool-not-method/13935) that the `Not` trait which brings that method in scope could be added to the prelude. This RFC author feels this use case is better served by adding an inherent impl to `bool`, since that serves the majority of the same use case with less complexity.
81-
- `std::fmt::Display`: users of this trait generally don't need to import it because the `ToString` trait which relies on the `Display` implementation is already in the prelude. Implementers of the `Display` trait however need several other items from `std::fmt` to do so; therefore, just importing `Display` into the prelude does not help much. This RFC suggests adding `fmt` to the prelude to improve this use case.
81+
- `std::fmt::Display`: users of this trait generally don't need to import it because the `ToString` trait which relies on the `Display` implementation is already in the prelude. Implementers of the `Display` trait however need several other items from `std::fmt` to do so; therefore, just importing `Display` into the prelude does not help much.
8282
- `std::fmt::Debug`: similar to `Display`, although there's no `to_debug()`. However, usage will usually go through `dbg!()` or the formatting mechanism (as a `{:?}` format string).
8383
- `std::future::Future`: `Future`'s `poll()` method is usually not called directly, but most often used via `async`/`await`, therefore including `Future` in the prelude does not seem as useful.
8484
- `std::error::Error`: while this is commonly implemented, calling its methods directly does not seem to be common enough that adding this is as useful.

0 commit comments

Comments
 (0)