mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
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
@ -526,25 +526,6 @@ macro_rules! write {
|
||||
/// 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]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg_attr(not(test), rustc_diagnostic_item = "writeln_macro")]
|
||||
|
Loading…
Reference in New Issue
Block a user