♻️ refactor(delete): use GmailClient for message list creation

- use GmailClient struct for creating a new message list
- this change improve code maintainability and testability
This commit is contained in:
Jeremiah Russell
2025-10-13 13:45:13 +01:00
committed by Jeremiah Russell
parent 3dab10fdfe
commit a22ce8e882

View File

@@ -1,6 +1,6 @@
use google_gmail1::api::BatchDeleteMessagesRequest;
use crate::{MessageList, Result};
use crate::{GmailClient, MessageList, Result};
/// Struct for deleting messages
#[derive(Debug)]
@@ -10,8 +10,8 @@ pub struct Delete {
impl Delete {
/// Create a new Delete struct
pub async fn new(credential: &str) -> Result<Self> {
let message_list = MessageList::new(credential).await?;
pub async fn new(client: &GmailClient) -> Result<Self> {
let message_list = MessageList::new(client).await?;
Ok(Delete { message_list })
}