-
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
Doc improvement on std::fmt module #33129
Conversation
|
Updated. |
/// use std::fmt; | ||
/// | ||
/// let mut output = String::new(); | ||
/// fmt::write(&mut output, format_args!("Hello {}!", "world")).unwrap(); |
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.
Could this maybe use try!
instead? It will require wrapping it in a function, like most of the IO docs do.
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.
I didn't want to do it because of this. I think that adding a function (and more code) will lose the point I'm trying to demonstrate.
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.
Yes, but unwrap()
is not the idiomatic way to handle errors, and we don't want to show unidiomatic code.
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.
Then I'll go with a full match pattern.
08e19da
to
93532fb
Compare
Updated (I went for |
I am still not sure that i prefer expect here, but we also have no official standards, so seems fine. @bors: r+ rollup |
📌 Commit 93532fb has been approved by |
⌛ Testing commit 93532fb with merge 2f3d5c4... |
💔 Test failed - auto-linux-64-opt-rustbuild |
Updated. |
@GuillaumeGomez did you push? I'm not seeing a new commit. |
I squashed it. I fixed the failed test. |
Weird, github's UI is being very strange. @bors: r+ rollup |
📌 Commit 0690720 has been approved by |
Doc improvement on std::fmt module Part of rust-lang#29355. r? @steveklabnik
@bors r- please don't commit libc changes. Don't use |
Doc improvement on std::fmt module Part of rust-lang#29355. r? @steveklabnik
Doc improvement on std::fmt module Part of rust-lang#29355. r? @steveklabnik
Doc improvement on std::fmt module Part of rust-lang#29355. r? @steveklabnik
|
I checked the urls by hand. It's getting strange... |
@Manishearth: I just re-checked: both urls are correct. |
But does the linkcheck make step pass? |
Note that the This is the case since |
@mitaa: Any clue about the guilty url? |
Maybe you could always link to the |
I'll try it. Thanks! |
Doc improvement on std::fmt module Part of rust-lang#29355. r? @steveklabnik
@bors: r- |
And updated again. |
@bors: r+ rollup |
📌 Commit 0908d66 has been approved by |
Doc improvement on std::fmt module Part of rust-lang#29355. r? @steveklabnik
Part of #29355.
r? @steveklabnik