Skip to content

Commit 4df1a55

Browse files
committed
Touch up Debug example from PR 92322
1 parent 1773e83 commit 4df1a55

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: library/core/src/fmt/mod.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -572,16 +572,20 @@ impl Display for Arguments<'_> {
572572
///
573573
/// [`debug_struct`]: Formatter::debug_struct
574574
///
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+
///
576580
/// ```
577581
/// # use std::fmt;
578582
/// # struct Point {
579583
/// # x: i32,
580584
/// # y: i32,
581585
/// # }
582-
///
586+
/// #
583587
/// 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 {
585589
/// write!(f, "Point [{} {}]", self.x, self.y)
586590
/// }
587591
/// }

0 commit comments

Comments
 (0)