summaryrefslogtreecommitdiff
path: root/cli/fs_util.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2021-11-01 16:22:08 -0400
committerGitHub <noreply@github.com>2021-11-01 16:22:08 -0400
commit2794d0b7a29dc2c84438f5004dd35d00d6d29007 (patch)
tree966bcc5a6163014868443f028c1397082635cd50 /cli/fs_util.rs
parentb92019a8475a16213028ab73b15be5a3f7c56e0a (diff)
fix(fmt/lint): strip unc paths on Windows when displaying file paths in lint and fmt (#12606)
Diffstat (limited to 'cli/fs_util.rs')
-rw-r--r--cli/fs_util.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/fs_util.rs b/cli/fs_util.rs
index 88855b0e8..21a9a6aad 100644
--- a/cli/fs_util.rs
+++ b/cli/fs_util.rs
@@ -233,14 +233,14 @@ where
// retain only the paths which exist and ignore the rest
let canonicalized_ignore: Vec<PathBuf> = ignore
.iter()
- .filter_map(|i| i.canonicalize().ok())
+ .filter_map(|i| canonicalize_path(i).ok())
.collect();
for file in files {
for entry in WalkDir::new(file)
.into_iter()
.filter_entry(|e| {
- e.path().canonicalize().map_or(false, |c| {
+ canonicalize_path(e.path()).map_or(false, |c| {
!canonicalized_ignore.iter().any(|i| c.starts_with(i))
})
})
@@ -249,7 +249,7 @@ where
_ => None,
})
{
- target_files.push(entry.into_path().canonicalize()?)
+ target_files.push(canonicalize_path(entry.path())?)
}
}