mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
[yabridgectl] Rewrite the blacklist check
This commit is contained in:
@@ -351,11 +351,10 @@ pub fn index(directory: &Path, blacklist: &HashSet<&Path>) -> SearchIndex {
|
|||||||
.filter_entry(|e| {
|
.filter_entry(|e| {
|
||||||
// The blacklist entries are canonicalized to resolve symlinks and to normalize slashes,
|
// The blacklist entries are canonicalized to resolve symlinks and to normalize slashes,
|
||||||
// so we should do the same thing here as well
|
// so we should do the same thing here as well
|
||||||
if let Ok(p) = e.path().canonicalize() {
|
e.path()
|
||||||
!blacklist.contains(p.as_path())
|
.canonicalize()
|
||||||
} else {
|
.map(|p| !blacklist.contains(p.as_path()))
|
||||||
true
|
.unwrap_or(false)
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.filter_map(|e| e.ok())
|
.filter_map(|e| e.ok())
|
||||||
.filter(|e| !e.file_type().is_dir())
|
.filter(|e| !e.file_type().is_dir())
|
||||||
|
|||||||
Reference in New Issue
Block a user