Closed
Description
The docs for std::fmt::Write
discourage using it outside of the standard library:
[…] This is similar to the standard library's io::Write trait, but it is only intended for use in libcore.
This trait should generally not be implemented by consumers of the standard library. The
write!
macro accepts an instance ofio::Write
, and theio::Write
trait is favored over implementing this trait.
Yet it is relatively often that one needs a trait for writing Unicode to a stream. For example, pulldown-cmark
has a trait very similar to this one called StrWrite
.
When I asked in Zulip, nobody seemed to know why that comment is there.
It would be good to have a standard that every library can use for this.
@rustbot modify labels: A-fmt T-libs T-doc