Skip to content

Rollup of 4 pull requests #62458

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

Merged
merged 9 commits into from
Jul 7, 2019
Next Next commit
First question mark in doctest
  • Loading branch information
llogiq committed Jul 3, 2019
commit ee05fc8104e5e2fecf8f67fc3d4259d5d576a20f
11 changes: 7 additions & 4 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,14 @@ macro_rules! r#try {
/// ```
/// use std::io::Write;
///
/// let mut w = Vec::new();
/// write!(&mut w, "test").unwrap();
/// write!(&mut w, "formatted {}", "arguments").unwrap();
/// fn main() -> std::io::Result<()> {
/// let mut w = Vec::new();
/// write!(&mut w, "test")?;
/// write!(&mut w, "formatted {}", "arguments")?;
///
/// assert_eq!(w, b"testformatted arguments");
/// assert_eq!(w, b"testformatted arguments");
/// Ok(())
/// }
/// ```
///
/// A module can import both `std::fmt::Write` and `std::io::Write` and call `write!` on objects
Expand Down