🎨 style(rule_processor): apply rustfmt and resolve clippy warnings

This commit is contained in:
Jeremiah Russell
2025-10-19 09:23:20 +01:00
committed by Jeremiah Russell
parent f16eb0a768
commit 06d63fbd03

View File

@@ -449,7 +449,7 @@ impl RuleProcessor for GmailClient {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use crate::{rules::EolRule, EolAction, Error}; use crate::{EolAction, Error, rules::EolRule};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
/// Test helper to create a simple EolRule with or without a query /// 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) /// Create a client that simulates missing labels (add_labels succeeds but no label_ids)
fn with_missing_labels() -> Self { fn with_missing_labels() -> Self {
let mut client = Self::default(); Self {
client.simulate_missing_labels = true; simulate_missing_labels: true,
// This client will accept add_labels but won't populate label_ids, ..Default::default()
// simulating the case where labels don't exist in the mailbox }
client
} }
fn with_labels(label_ids: Vec<String>) -> Self { fn with_labels(label_ids: Vec<String>) -> Self {
@@ -522,14 +521,21 @@ mod tests {
} }
fn with_failure(failure_type: &str) -> Self { fn with_failure(failure_type: &str) -> Self {
let mut client = Self::default();
match failure_type { match failure_type {
"add_labels" => client.should_fail_add_labels = true, "add_labels" => Self {
"prepare" => client.should_fail_prepare = true, should_fail_add_labels: true,
"batch_trash" => client.should_fail_batch_trash = 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 { fn get_batch_trash_call_count(&self) -> u32 {