@@ -662,7 +662,7 @@ pub trait Display {
662
662
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
663
663
/// let val = self.0;
664
664
///
665
- /// write!(f, "{:o}", val ) // delegate to i32's implementation
665
+ /// fmt::Octal::fmt(&val, f ) // delegate to i32's implementation
666
666
/// }
667
667
/// }
668
668
///
@@ -712,7 +712,7 @@ pub trait Octal {
712
712
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
713
713
/// let val = self.0;
714
714
///
715
- /// write!(f, "{:b}", val ) // delegate to i32's implementation
715
+ /// fmt::Binary::fmt(&val, f ) // delegate to i32's implementation
716
716
/// }
717
717
/// }
718
718
///
@@ -771,7 +771,7 @@ pub trait Binary {
771
771
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
772
772
/// let val = self.0;
773
773
///
774
- /// write!(f, "{:x}", val ) // delegate to i32's implementation
774
+ /// fmt::LowerHex::fmt(&val, f ) // delegate to i32's implementation
775
775
/// }
776
776
/// }
777
777
///
@@ -824,7 +824,7 @@ pub trait LowerHex {
824
824
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
825
825
/// let val = self.0;
826
826
///
827
- /// write!(f, "{:X}", val ) // delegate to i32's implementation
827
+ /// fmt::UpperHex::fmt(&val, f ) // delegate to i32's implementation
828
828
/// }
829
829
/// }
830
830
///
@@ -869,7 +869,8 @@ pub trait UpperHex {
869
869
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
870
870
/// // use `as` to convert to a `*const T`, which implements Pointer, which we can use
871
871
///
872
- /// write!(f, "{:p}", self as *const Length)
872
+ /// let ptr = self as *const Self;
873
+ /// fmt::Pointer::fmt(&ptr, f)
873
874
/// }
874
875
/// }
875
876
///
0 commit comments