We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4fb77a0 commit ee05fc8Copy full SHA for ee05fc8
src/libcore/macros.rs
@@ -335,11 +335,14 @@ macro_rules! r#try {
335
/// ```
336
/// use std::io::Write;
337
///
338
-/// let mut w = Vec::new();
339
-/// write!(&mut w, "test").unwrap();
340
-/// write!(&mut w, "formatted {}", "arguments").unwrap();
+/// fn main() -> std::io::Result<()> {
+/// let mut w = Vec::new();
+/// write!(&mut w, "test")?;
341
+/// write!(&mut w, "formatted {}", "arguments")?;
342
-/// assert_eq!(w, b"testformatted arguments");
343
+/// assert_eq!(w, b"testformatted arguments");
344
+/// Ok(())
345
+/// }
346
347
348
/// A module can import both `std::fmt::Write` and `std::io::Write` and call `write!` on objects
0 commit comments