diff --git a/src/parameters.rs b/src/parameters.rs index 1fff38f..5eb3bca 100644 --- a/src/parameters.rs +++ b/src/parameters.rs @@ -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) } }