i have an integer like this:
let x: u8 = 0b101;
and i need to convert it to string like this:
let s = "101";
or array:
let a = [1, 0, 1];
but rust by default converting already converted binary int to decimal to string so i receiving:
let x = 0b101;
println!("{:?}", x.to_string()); // 5
how to convert binary number to string or array without this?
i tried x.to_ne_bytes() and to_be_bytes() but it`s also returning alredy converted do dec number