diff --git a/src/concepts/action.rs b/src/concepts/action.rs index acd11d7..c63724e 100644 --- a/src/concepts/action.rs +++ b/src/concepts/action.rs @@ -172,6 +172,7 @@ impl Display for Action { #[cfg(test)] impl Action { /// Test-only constructor designed to be easy to call + #[allow(clippy::too_many_arguments)] pub fn new( cmd: Vec<&str>, after: Option<&str>, @@ -212,15 +213,18 @@ pub mod tests { use super::*; pub fn ok_action() -> Action { - let mut action = Action::default(); - action.cmd = vec!["command".into()]; - action + Action { + cmd: vec!["command".into()], + ..Default::default() + } } pub fn ok_action_with_after(d: String, name: &str) -> Action { - let mut action = Action::default(); - action.cmd = vec!["command".into()]; - action.after = Some(d); + let mut action = Action { + cmd: vec!["command".into()], + after: Some(d), + ..Default::default() + }; action .setup("", "", name, Arc::new(BTreeSet::default())) .unwrap(); diff --git a/src/daemon/filter/mod.rs b/src/daemon/filter/mod.rs index 0b86562..b6a251b 100644 --- a/src/daemon/filter/mod.rs +++ b/src/daemon/filter/mod.rs @@ -318,7 +318,7 @@ impl FilterManager { // unwrap is fine because map is not empty (see if) let map = match self.filter.duplicate { // Keep only last item - Duplicate::Extend => BTreeMap::from([map.into_iter().last().unwrap()]), + Duplicate::Extend => BTreeMap::from([map.into_iter().next_back().unwrap()]), // Keep only first item Duplicate::Ignore => BTreeMap::from([map.into_iter().next().unwrap()]), // No filtering