gitui/invalidstring/src/lib.rs
Stephan Dilly dad8e8d43d cargo fmt: use hardtabs
since it does not support hard-whitespaces its the only way to make whitespaces consisitent and checked
2021-08-17 14:24:25 +02:00

8 lines
213 B
Rust

/// uses unsafe to postfix the string with invalid utf8 data
pub fn invalid_utf8(prefix: &str) -> String {
let bytes = b"\xc3\x73";
unsafe {
format!("{}{}", prefix, std::str::from_utf8_unchecked(bytes))
}
}