Skip to content

Commit 3c0971d

Browse files
committed
fix: streamline trailing slash removal in Windows path normalization
1 parent 40bef0d commit 3c0971d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

crates/pet-fs/src/path.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ fn normalize_case_windows(path: &Path) -> Option<PathBuf> {
8383

8484
// Strip trailing path separators to match canonicalize behavior
8585
// (but keep the root like "C:\")
86-
while result_str.len() > 3
87-
&& (result_str.ends_with('\\') || result_str.ends_with('/'))
88-
{
86+
while result_str.len() > 3 && (result_str.ends_with('\\') || result_str.ends_with('/')) {
8987
result_str.pop();
9088
}
9189

0 commit comments

Comments
 (0)