#![allow(dead_code, deprecated, unused_variables, unused_mut)] use std::fmt; struct Length(i32); impl fmt::Binary for Length { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let val = self.0; fmt::Binary::fmt(&val, f) } } fn main() { let l = Length(107); assert_eq!(format!("l as binary is: {l:b}"), "l as binary is: 1101011"); assert_eq!( format!("l as binary is: {l:#034b}"), "l as binary is: 0b00000000000000000000000001101011" ); }