pathutil.rs (ripgrep-12.1.1) | : | pathutil.rs (ripgrep-13.0.0) | ||
---|---|---|---|---|
skipping to change at line 63 | skipping to change at line 63 | |||
let mut name = name.clone(); | let mut name = name.clone(); | |||
name.drain_bytes(..last_dot_at); | name.drain_bytes(..last_dot_at); | |||
Cow::Owned(name) | Cow::Owned(name) | |||
} | } | |||
}) | }) | |||
} | } | |||
/// Normalizes a path to use `/` as a separator everywhere, even on platforms | /// Normalizes a path to use `/` as a separator everywhere, even on platforms | |||
/// that recognize other characters as separators. | /// that recognize other characters as separators. | |||
#[cfg(unix)] | #[cfg(unix)] | |||
pub fn normalize_path(path: Cow<[u8]>) -> Cow<[u8]> { | pub fn normalize_path(path: Cow<'_, [u8]>) -> Cow<'_, [u8]> { | |||
// UNIX only uses /, so we're good. | // UNIX only uses /, so we're good. | |||
path | path | |||
} | } | |||
/// Normalizes a path to use `/` as a separator everywhere, even on platforms | /// Normalizes a path to use `/` as a separator everywhere, even on platforms | |||
/// that recognize other characters as separators. | /// that recognize other characters as separators. | |||
#[cfg(not(unix))] | #[cfg(not(unix))] | |||
pub fn normalize_path(mut path: Cow<[u8]>) -> Cow<[u8]> { | pub fn normalize_path(mut path: Cow<[u8]>) -> Cow<[u8]> { | |||
use std::path::is_separator; | use std::path::is_separator; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |