-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-fmtArea: `core::fmt`Area: `core::fmt`T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
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
schneiderfelipe
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-fmtArea: `core::fmt`Area: `core::fmt`T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.