@@ -662,7 +662,7 @@ pub trait Display {
662662///     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 
663663///         let val = self.0; 
664664/// 
665- ///         write!(f, "{:o}", val ) // delegate to i32's implementation 
665+ ///         fmt::Octal::fmt(&val, f ) // delegate to i32's implementation 
666666///     } 
667667/// } 
668668/// 
@@ -712,7 +712,7 @@ pub trait Octal {
712712///     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 
713713///         let val = self.0; 
714714/// 
715- ///         write!(f, "{:b}", val ) // delegate to i32's implementation 
715+ ///         fmt::Binary::fmt(&val, f ) // delegate to i32's implementation 
716716///     } 
717717/// } 
718718/// 
@@ -771,7 +771,7 @@ pub trait Binary {
771771///     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 
772772///         let val = self.0; 
773773/// 
774- ///         write!(f, "{:x}", val ) // delegate to i32's implementation 
774+ ///         fmt::LowerHex::fmt(&val, f ) // delegate to i32's implementation 
775775///     } 
776776/// } 
777777/// 
@@ -824,7 +824,7 @@ pub trait LowerHex {
824824///     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 
825825///         let val = self.0; 
826826/// 
827- ///         write!(f, "{:X}", val ) // delegate to i32's implementation 
827+ ///         fmt::UpperHex::fmt(&val, f ) // delegate to i32's implementation 
828828///     } 
829829/// } 
830830/// 
@@ -869,7 +869,8 @@ pub trait UpperHex {
869869///     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 
870870///         // use `as` to convert to a `*const T`, which implements Pointer, which we can use 
871871/// 
872- ///         write!(f, "{:p}", self as *const Length) 
872+ ///         let ptr = self as *const Self; 
873+ ///         fmt::Pointer::fmt(&ptr, f) 
873874///     } 
874875/// } 
875876/// 
0 commit comments