mirror of
https://framagit.org/ppom/reaction
synced 2026-03-14 20:55:47 +01:00
cargo fmt, cargo clippy --all-targets
This commit is contained in:
parent
35862d32fa
commit
6a778f3d01
5 changed files with 7 additions and 14 deletions
|
|
@ -280,7 +280,7 @@ impl Filter {
|
|||
}
|
||||
|
||||
for pattern in self.patterns.iter() {
|
||||
if patterns.get(pattern).is_none() {
|
||||
if !patterns.contains_key(pattern) {
|
||||
return Err(format!(
|
||||
"pattern {} is missing, because it's in the filter {}.{}",
|
||||
pattern.name(),
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ impl State {
|
|||
pub fn remove_match(&mut self, m: &Match) {
|
||||
if let Some(set) = self.matches.get(m) {
|
||||
for t in set {
|
||||
self.ordered_times.remove(&t);
|
||||
self.ordered_times.remove(t);
|
||||
}
|
||||
self.matches.remove(m);
|
||||
}
|
||||
|
|
@ -132,7 +132,7 @@ impl State {
|
|||
// unwrap: we just checked in the condition that first is_some
|
||||
let (t, m) = {
|
||||
let (t, m) = self.ordered_times.first_key_value().unwrap();
|
||||
(t.clone(), m.clone())
|
||||
(*t, m.clone())
|
||||
};
|
||||
self.ordered_times.remove(&t);
|
||||
if let Some(set) = self.matches.get(&m) {
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ async fn trigger_matched_pattern() {
|
|||
|
||||
let mut db = TempDatabase::default().await;
|
||||
db.set_loaded_db(HashMap::from([(
|
||||
filter_ordered_times_db_name(&filter),
|
||||
filter_ordered_times_db_name(filter),
|
||||
HashMap::from([(now1s.to_rfc3339().into(), one.clone().into())]),
|
||||
)]));
|
||||
let bed = bed.part2(filter, now, Some(db)).await;
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ fn answer_order(
|
|||
// retrieve or Err
|
||||
.find(|(pattern_name, _)| &name == *pattern_name)
|
||||
.ok_or_else(|| format!("pattern '{name}' doesn't exist"))
|
||||
.and_then(|(_, pattern)| Ok((pattern.clone(), reg)))
|
||||
.map(|(_, pattern)| (pattern.clone(), reg))
|
||||
})
|
||||
.collect::<Result<BTreeMap<Arc<Pattern>, String>, String>>()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -225,10 +225,7 @@ async fn simple() {
|
|||
env::set_current_dir(&dir).unwrap();
|
||||
|
||||
// No thing from stream
|
||||
config_with_cmd(
|
||||
config_path,
|
||||
"sleep 0.1",
|
||||
);
|
||||
config_with_cmd(config_path, "sleep 0.1");
|
||||
|
||||
file_with_contents(out_path, "");
|
||||
|
||||
|
|
@ -255,9 +252,5 @@ async fn simple() {
|
|||
assert!(trigger.is_ok());
|
||||
|
||||
// make sure the trigger number is in the output
|
||||
assert_eq!(
|
||||
get_file_content(out_path).trim(),
|
||||
"95".to_owned()
|
||||
);
|
||||
|
||||
assert_eq!(get_file_content(out_path).trim(), "95".to_owned());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue