Skip to content

Commit a788650

Browse files
committed
Remove some documentation duplicated between writeln! and write!
`writeln!` already includes a reference to `write!` for more information, so remove duplicated information.
1 parent f03ce30 commit a788650

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

library/core/src/macros/mod.rs

-19
Original file line numberDiff line numberDiff line change
@@ -526,25 +526,6 @@ macro_rules! write {
526526
/// Ok(())
527527
/// }
528528
/// ```
529-
///
530-
/// A module can import both `std::fmt::Write` and `std::io::Write` and call `write!` on objects
531-
/// implementing either, as objects do not typically implement both. However, the module must
532-
/// import the traits qualified so their names do not conflict:
533-
///
534-
/// ```
535-
/// use std::fmt::Write as FmtWrite;
536-
/// use std::io::Write as IoWrite;
537-
///
538-
/// fn main() -> Result<(), Box<dyn std::error::Error>> {
539-
/// let mut s = String::new();
540-
/// let mut v = Vec::new();
541-
///
542-
/// writeln!(&mut s, "{} {}", "abc", 123)?; // uses fmt::Write::write_fmt
543-
/// writeln!(&mut v, "s = {:?}", s)?; // uses io::Write::write_fmt
544-
/// assert_eq!(v, b"s = \"abc 123\\n\"\n");
545-
/// Ok(())
546-
/// }
547-
/// ```
548529
#[macro_export]
549530
#[stable(feature = "rust1", since = "1.0.0")]
550531
#[cfg_attr(not(test), rustc_diagnostic_item = "writeln_macro")]

0 commit comments

Comments
 (0)