I am try to convert a int to binary with 000 in the front, my code is
fn int32_to_binerystr(i: &i32, width: &usize) -> str {
let mut s = format!("{:032b}", i);
let from = s.len() - width;
let to = s.len();
s[from..to]
}
it complian about :
the size for values of type `str` cannot be known at compilation time
the trait `Sized` is not implemented for `str`
the return type of a function must have a statically known size rustcE0277
how to fix this?