File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -572,16 +572,20 @@ impl Display for Arguments<'_> {
572
572
///
573
573
/// [`debug_struct`]: Formatter::debug_struct
574
574
///
575
- /// For custom cases, it's also possible to implement `Debug` using the [`write!`] macro:
575
+ /// Types that do not wish to use the standard suite of debug representations
576
+ /// provided by the `Formatter` trait (`debug_struct`, `debug_tuple`,
577
+ /// `debut_list`, `debug_set`, `debug_map`) can do something totally custom by
578
+ /// manually writing an arbitrary representation to the `Formatter`.
579
+ ///
576
580
/// ```
577
581
/// # use std::fmt;
578
582
/// # struct Point {
579
583
/// # x: i32,
580
584
/// # y: i32,
581
585
/// # }
582
- ///
586
+ /// #
583
587
/// impl fmt::Debug for Point {
584
- /// fn fmt(&self, f: &mut fmt::Formatter <'_>) -> fmt::Result {
588
+ /// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
585
589
/// write!(f, "Point [{} {}]", self.x, self.y)
586
590
/// }
587
591
/// }
You can’t perform that action at this time.
0 commit comments