gix_path

Function try_into_bstr

source
pub fn try_into_bstr<'a>(
    path: impl Into<Cow<'a, Path>>,
) -> Result<Cow<'a, BStr>, Utf8Error>
Expand description

Convert the given path either into its raw bytes on unix or its UTF8 encoded counterpart on windows.

On windows, if the source Path contains ill-formed, lone surrogates, the UTF-8 conversion will fail causing Utf8Error to be returned.