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![];
|
let mut excluded = vec![];
|
||||||
if let Some(exclude) = self.exclude.as_ref() {
|
if let Some(exclude) = self.exclude.as_ref() {
|
||||||
// add extensions excluded by `-x`
|
// 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 {
|
if let Some(exclude_set) = &self.exclude_set {
|
||||||
// add extensions excluded by `-X`
|
// 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
|
// no extensions to exclude - return none
|
||||||
None
|
x if x.is_empty() => None,
|
||||||
} else {
|
|
||||||
// excluded doesn't sound like a word anymore
|
// excluded doesn't sound like a word anymore
|
||||||
// tongue twister: enter X-options' excellent extension exclusion
|
// tongue twister: enter X-options' excellent extension exclusion
|
||||||
Some(excluded)
|
x => Some(x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue