♻️ 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:
committed by
Jeremiah Russell
parent
3dab10fdfe
commit
a22ce8e882
@@ -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 })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user