File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -474,6 +474,23 @@ macro_rules! r#try {
474
474
/// }
475
475
/// ```
476
476
///
477
+ /// If you also need the trait names themselves, such as to implement one or both on your types,
478
+ /// import the containing module and then name them with a prefix:
479
+ ///
480
+ /// ```
481
+ /// # #![allow(unused_imports)]
482
+ /// use std::fmt::{self, Write as _};
483
+ /// use std::io::{self, Write as _};
484
+ ///
485
+ /// struct Example;
486
+ ///
487
+ /// impl fmt::Write for Example {
488
+ /// fn write_str(&mut self, _s: &str) -> core::fmt::Result {
489
+ /// unimplemented!();
490
+ /// }
491
+ /// }
492
+ /// ```
493
+ ///
477
494
/// Note: This macro can be used in `no_std` setups as well.
478
495
/// In a `no_std` setup you are responsible for the implementation details of the components.
479
496
///
You can’t perform that action at this time.
0 commit comments