mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-23 02:27:39 +03:00
Rollup merge of #55047 - tshepang:simple, r=alexcrichton
doc: make core::fmt::Error example more simple
This commit is contained in:
@@ -96,9 +96,8 @@ pub mod rt {
|
||||
/// use std::fmt::{self, write};
|
||||
///
|
||||
/// let mut output = String::new();
|
||||
/// match write(&mut output, format_args!("Hello {}!", "world")) {
|
||||
/// Err(fmt::Error) => panic!("An error occurred"),
|
||||
/// _ => (),
|
||||
/// if let Err(fmt::Error) = write(&mut output, format_args!("Hello {}!", "world")) {
|
||||
/// panic!("An error occurred");
|
||||
/// }
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
Reference in New Issue
Block a user