-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a cleaner documentation for 'write!' #35279
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,8 +231,8 @@ macro_rules! try { | |
|
||
/// Calls `write_fmt` function on a writer | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps
could be a better first sentence? Note that this sentence is a short summary that user will see in rustdoc search and various listings, so it is not necessary to provide implementation details here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That looks much better. Thank you. I was already aware that it needed to be as short as possible, since I compiled the docs and experienced it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One question, should it be "Writes" or "Write"? Some macros "Ensure", some "Asserts". I'm confused There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either works, I guess. I’m ambivalent, but @steveklabnik might have a stronger preference towards one of them. |
||
/// | ||
/// This macro takes an implementer of [`std::fmt::Write`][fmt_write] or | ||
/// [`std::io::Write`][io_write] trait, a precompiled format string, and a list of arguments. | ||
/// This macro takes an implementor of [`std::fmt::Write`][fmt_write] or | ||
/// [`std::io::Write`][io_write] trait, a format string, and a list of arguments. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implementation of macro does not seem to demand writer to implement any of these traits, only to have a method called I feel like something along the lines of
would be more technically correct. |
||
/// | ||
/// Implementors of the `Write` trait are sometimes called 'writers'. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure which is correct, but on line 237 we have "Implementors" (with an O) and on line 234 "implementer" (with an E). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. Thanks for noticing. I'm not sure though. This says they're just different spellings. https://en.wiktionary.org/wiki/implementer#English And I grepped both of them right now
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I decided to use "Implementor" |
||
/// | ||
|
@@ -272,8 +272,8 @@ macro_rules! write { | |
/// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) | ||
/// alone (no additional CARRIAGE RETURN (`\r`/`U+000D`). | ||
/// | ||
/// This macro takes an implementer of [`std::fmt::Write`][fmt_write] or | ||
/// [`std::io::Write`][io_write] trait, a precompiled format string, and a list of arguments. | ||
/// This macro takes an implementor of [`std::fmt::Write`][fmt_write] or | ||
/// [`std::io::Write`][io_write] trait, a format string, and a list of arguments. | ||
/// | ||
/// Implementors of the `Write` trait are sometimes called 'writers'. | ||
/// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@steveklabnik Hello. Can you suggest a better, "friendlier" description instead of this? 😄