ref(clippy): Flatten iterator instead of if let
It seems nightly clippy prefers you to flatten the iterator instead of
using if let inside.  Must admit it looks a little cleaner.
@@ -509,14 +509,15 @@ pub fn matches_path_patterns(object_id: &ObjectId, patterns: &[Glob]) -> bool {
}
for pattern in patterns {
- for path in &[&object_id.code_file, &object_id.debug_file] {
- if let Some(ref path) = path {
+ for path in [object_id.code_file.as_ref(), object_id.debug_file.as_ref()]
+ .iter()
+ .flatten()
+ {
if pattern.matches_with(&canonicalize_path(path), GLOB_OPTIONS) {
return true;
}
}
}
- }
false
}
