Rollup merge of #55047 - tshepang:simple, r=alexcrichton

doc: make core::fmt::Error example more simple
This commit is contained in:
Manish Goregaokar 2018-10-15 10:15:16 -07:00 committed by GitHub
commit dc87247538
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,9 +96,8 @@ pub type Result = result::Result<(), Error>;
/// 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")]