Function stackfmt::fmt_truncate [−][src]
Expand description
Writes formatted string into the buffer truncating if needed making the result valid utf8.
Example:
let mut buf = [0u8; 6];
let formatted: &str = stackfmt::fmt_truncate(&mut buf, format_args!("Hello{}", 42));
assert_eq!(formatted, "Hello4");