Skip to content

Commit ee05fc8

Browse files
committed
First question mark in doctest
1 parent 4fb77a0 commit ee05fc8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/libcore/macros.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,14 @@ macro_rules! r#try {
335335
/// ```
336336
/// use std::io::Write;
337337
///
338-
/// let mut w = Vec::new();
339-
/// write!(&mut w, "test").unwrap();
340-
/// write!(&mut w, "formatted {}", "arguments").unwrap();
338+
/// fn main() -> std::io::Result<()> {
339+
/// let mut w = Vec::new();
340+
/// write!(&mut w, "test")?;
341+
/// write!(&mut w, "formatted {}", "arguments")?;
341342
///
342-
/// assert_eq!(w, b"testformatted arguments");
343+
/// assert_eq!(w, b"testformatted arguments");
344+
/// Ok(())
345+
/// }
343346
/// ```
344347
///
345348
/// A module can import both `std::fmt::Write` and `std::io::Write` and call `write!` on objects

0 commit comments

Comments
 (0)