String::from_utf8_lossy(&[u8]) -> Cow<'_, str> Basically let x: &str = &String::from_utf8_lossy(&[1, 7, 4, 32, 69]);