cargo clippy

This commit is contained in:
ppom 2025-08-05 12:00:00 +02:00
commit a1df62077c
No known key found for this signature in database
2 changed files with 11 additions and 7 deletions

View file

@ -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();

View file

@ -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