mirror of
https://framagit.org/ppom/reaction
synced 2026-03-14 20:55:47 +01:00
cargo clippy
This commit is contained in:
parent
56e4d77854
commit
a1df62077c
2 changed files with 11 additions and 7 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue