|
|
|
|
|
by steveklabnik
3361 days ago
|
|
The write! macro would be the equivalent here. Something like this: use std::io::Write;
static mut S1: [u8; 17] = [0; 17];
fn main() {
unsafe {
write!(&mut S1[..], "Hi: {}", 5).unwrap();
let s = std::str::from_utf8_unchecked(&S1[..5]);
println!("string: {}", s);
}
}
|
|