@@ -348,25 +348,6 @@ macro_rules! r#try {
348
348
/// }
349
349
/// ```
350
350
///
351
- /// A module can import both `std::fmt::Write` and `std::io::Write` and call `write!` on objects
352
- /// implementing either, as objects do not typically implement both. However, the module must
353
- /// import the traits qualified so their names do not conflict:
354
- ///
355
- /// ```
356
- /// use std::fmt::Write as FmtWrite;
357
- /// use std::io::Write as IoWrite;
358
- ///
359
- /// fn main() -> Result<(), Box<dyn std::error::Error>> {
360
- /// let mut s = String::new();
361
- /// let mut v = Vec::new();
362
- ///
363
- /// write!(&mut s, "{} {}", "abc", 123)?; // uses fmt::Write::write_fmt
364
- /// write!(&mut v, "s = {:?}", s)?; // uses io::Write::write_fmt
365
- /// assert_eq!(v, b"s = \"abc 123\"");
366
- /// Ok(())
367
- /// }
368
- /// ```
369
- ///
370
351
/// Note: This macro can be used in `no_std` setups as well.
371
352
/// In a `no_std` setup you are responsible for the implementation details of the components.
372
353
///
@@ -416,25 +397,6 @@ macro_rules! write {
416
397
/// Ok(())
417
398
/// }
418
399
/// ```
419
- ///
420
- /// A module can import both `std::fmt::Write` and `std::io::Write` and call `write!` on objects
421
- /// implementing either, as objects do not typically implement both. However, the module must
422
- /// import the traits qualified so their names do not conflict:
423
- ///
424
- /// ```
425
- /// use std::fmt::Write as FmtWrite;
426
- /// use std::io::Write as IoWrite;
427
- ///
428
- /// fn main() -> Result<(), Box<dyn std::error::Error>> {
429
- /// let mut s = String::new();
430
- /// let mut v = Vec::new();
431
- ///
432
- /// writeln!(&mut s, "{} {}", "abc", 123)?; // uses fmt::Write::write_fmt
433
- /// writeln!(&mut v, "s = {:?}", s)?; // uses io::Write::write_fmt
434
- /// assert_eq!(v, b"s = \"abc 123\\n\"\n");
435
- /// Ok(())
436
- /// }
437
- /// ```
438
400
#[ macro_export]
439
401
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
440
402
#[ allow_internal_unstable( format_args_nl) ]
0 commit comments