🎨 style(rule_processor): apply rustfmt and resolve clippy warnings
This commit is contained in:
committed by
Jeremiah Russell
parent
f16eb0a768
commit
06d63fbd03
@@ -449,7 +449,7 @@ impl RuleProcessor for GmailClient {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{rules::EolRule, EolAction, Error};
|
||||
use crate::{EolAction, Error, rules::EolRule};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
/// Test helper to create a simple EolRule with or without a query
|
||||
@@ -507,11 +507,10 @@ mod tests {
|
||||
|
||||
/// Create a client that simulates missing labels (add_labels succeeds but no label_ids)
|
||||
fn with_missing_labels() -> Self {
|
||||
let mut client = Self::default();
|
||||
client.simulate_missing_labels = true;
|
||||
// This client will accept add_labels but won't populate label_ids,
|
||||
// simulating the case where labels don't exist in the mailbox
|
||||
client
|
||||
Self {
|
||||
simulate_missing_labels: true,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn with_labels(label_ids: Vec<String>) -> Self {
|
||||
@@ -522,14 +521,21 @@ mod tests {
|
||||
}
|
||||
|
||||
fn with_failure(failure_type: &str) -> Self {
|
||||
let mut client = Self::default();
|
||||
match failure_type {
|
||||
"add_labels" => client.should_fail_add_labels = true,
|
||||
"prepare" => client.should_fail_prepare = true,
|
||||
"batch_trash" => client.should_fail_batch_trash = true,
|
||||
_ => {},
|
||||
"add_labels" => Self {
|
||||
should_fail_add_labels: true,
|
||||
..Default::default()
|
||||
},
|
||||
"prepare" => Self {
|
||||
should_fail_prepare: true,
|
||||
..Default::default()
|
||||
},
|
||||
"batch_trash" => Self {
|
||||
should_fail_batch_trash: true,
|
||||
..Default::default()
|
||||
},
|
||||
_ => Self::default(),
|
||||
}
|
||||
client
|
||||
}
|
||||
|
||||
fn get_batch_trash_call_count(&self) -> u32 {
|
||||
|
||||
Reference in New Issue
Block a user