File tree 1 file changed +0
-19
lines changed
1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -526,25 +526,6 @@ macro_rules! write {
526
526
/// Ok(())
527
527
/// }
528
528
/// ```
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
- /// ```
548
529
#[ macro_export]
549
530
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
550
531
#[ cfg_attr( not( test) , rustc_diagnostic_item = "writeln_macro" ) ]
You can’t perform that action at this time.
0 commit comments