You’re overthinking the whole thing.
assert_eq!(format!("{:x}", 42), "2a");
assert_eq!(format!("{:X}", 42), "2A");
That’s from std::fmt::LowerHex and std::fmt::UpperHex, respectively. See also a search of the documentation for “hex”.
You’re overthinking the whole thing.
assert_eq!(format!("{:x}", 42), "2a");
assert_eq!(format!("{:X}", 42), "2A");
That’s from std::fmt::LowerHex and std::fmt::UpperHex, respectively. See also a search of the documentation for “hex”.