#![allow(dead_code, deprecated, unused_variables, unused_mut)] use std::fmt; struct Length(i32); impl fmt::Octal for Length { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let val = self.0; fmt::Octal::fmt(&val, f) } } fn main() { let l = Length(9); assert_eq!(format!("l as octal is: {l:o}"), "l as octal is: 11"); assert_eq!(format!("l as octal is: {l:#06o}"), "l as octal is: 0o0011"); }