In Rust you can format numbers in different bases, which is really useful for bit twiddling:
println!("{:?} {:b} {:x}", 42, 42, 42); // 42 101010 2a
Ideally this would also work for vectors! While it works for hex:
println!("{:#x?}", vec![42, 43, 44]); // [ 0x2a, 0x2b, 0x2c ]
It does not work for binary:
println!("{:b}", vec![42, 43, 44]); // I wish this were [101010, 101011, 101100]
Instead giving:
the trait bound
std::vec::Vec<{integer}>: std::fmt::Binary
is not satisfied
Is there a way of doing binary formatting inside vectors?