macro_rules! from_utf8 {
($s: expr) => { ... };
}
Expand description
Converts a byte string to a string slice
This macro is const-context only.
ยงExamples
const BYTE_PATH: &[u8] = b"/tmp/file";
const PATH: &str = const_str::from_utf8!(BYTE_PATH);
assert_eq!(PATH, "/tmp/file");