gix_path

Function try_from_byte_slice

Source
pub fn try_from_byte_slice(input: &[u8]) -> Result<&Path, Utf8Error>
Expand description

Given input bytes, produce a Path from them ignoring encoding entirely if on unix.

On windows, the input is required to be valid UTF-8, which is guaranteed if we wrote it before. There are some potential git versions and windows installation which produce mal-formed UTF-16 if certain emojies are in the path. It’s as rare as it sounds, but possible.