cleaned up excluded_extensions
This commit is contained in:
parent
d578efa7a4
commit
af3d51fcda
1 changed files with 5 additions and 6 deletions
|
@ -147,21 +147,20 @@ impl Parameters {
|
|||
let mut excluded = vec![];
|
||||
if let Some(exclude) = self.exclude.as_ref() {
|
||||
// add extensions excluded by `-x`
|
||||
excluded.append(&mut exclude.iter().map(|ext| ext.as_str()).collect());
|
||||
excluded.extend(exclude.iter().map(|ext| ext.as_str()));
|
||||
}
|
||||
|
||||
if let Some(exclude_set) = &self.exclude_set {
|
||||
// add extensions excluded by `-X`
|
||||
excluded.append(&mut exclude_set.extensions());
|
||||
excluded.extend_from_slice(&exclude_set.extensions());
|
||||
}
|
||||
|
||||
if excluded.is_empty() {
|
||||
match excluded {
|
||||
// no extensions to exclude - return none
|
||||
None
|
||||
} else {
|
||||
x if x.is_empty() => None,
|
||||
// excluded doesn't sound like a word anymore
|
||||
// tongue twister: enter X-options' excellent extension exclusion
|
||||
Some(excluded)
|
||||
x => Some(x)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue