pub fn normalize_slashes(path: PathBuf) -> Result<Vec<u8>, PathBuf>
Expand description
Normalize path separators to all be /
.
This function is a no-op on all non-Windows platforms. On Windows, this
function will convert \
separators to /
if the given PathBuf
is
valid UTF-8.
ยงErrors
On Unix platforms, this function is infallible. On all other platforms,
including Windows, if the given PathBuf
is not valid UTF-8, the original
PathBuf
is returned as an error. See Path::to_str
for details.