devela::_dep::const_str

Macro from_utf8

macro_rules! from_utf8 {
    ($s: expr) => { ... };
}
Available on crate feature dep_const_str only.
Expand description

Converts a byte string to a string slice

ยงExamples

const BYTE_PATH: &[u8] = b"/tmp/file";
const PATH: &str = const_str::from_utf8!(BYTE_PATH);

assert_eq!(PATH, "/tmp/file");