#Debug print integer slice as binary

5 messages · Page 1 of 1 (latest)

velvet wren
#

If I have an integer slice, say

let ints: &[u32] = ...;

I can debug print it with its elements as hex doing this

println!("{ints:x?}");

but I get a compilation error if I try doing the following to print it as binary

println!("{ints:b?}");

Can I achieve this without doing a for loop (or I guess some iterator stuff) manually?

verbal jetty
sharp hedgeBOT
verbal jetty
#

is that manual for you? I don't think you can do better

velvet wren
#

nah that's fine