Remove some documentation duplicated between writeln!
and write!
`writeln!` already includes a reference to `write!` for more information, so remove duplicated information.
This commit is contained in:
parent
f03ce30962
commit
a7886506ad
1 changed files with 0 additions and 19 deletions
|
@ -526,25 +526,6 @@ macro_rules! write {
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
|
||||||
/// A module can import both `std::fmt::Write` and `std::io::Write` and call `write!` on objects
|
|
||||||
/// implementing either, as objects do not typically implement both. However, the module must
|
|
||||||
/// import the traits qualified so their names do not conflict:
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// use std::fmt::Write as FmtWrite;
|
|
||||||
/// use std::io::Write as IoWrite;
|
|
||||||
///
|
|
||||||
/// fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
||||||
/// let mut s = String::new();
|
|
||||||
/// let mut v = Vec::new();
|
|
||||||
///
|
|
||||||
/// writeln!(&mut s, "{} {}", "abc", 123)?; // uses fmt::Write::write_fmt
|
|
||||||
/// writeln!(&mut v, "s = {:?}", s)?; // uses io::Write::write_fmt
|
|
||||||
/// assert_eq!(v, b"s = \"abc 123\\n\"\n");
|
|
||||||
/// Ok(())
|
|
||||||
/// }
|
|
||||||
/// ```
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(not(test), rustc_diagnostic_item = "writeln_macro")]
|
#[cfg_attr(not(test), rustc_diagnostic_item = "writeln_macro")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue