From 0dc8f8c47b01c62a3e9f09f25e576ad6f9ec7440 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Oct 2025 13:45:02 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(gmail):=20improve?= =?UTF-8?q?=20gmail=20client=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add clone derive to GmailClient struct - rename get_messages to get_message_list for clarity --- src/gmail_client.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gmail_client.rs b/src/gmail_client.rs index a1de336..82a4d13 100644 --- a/src/gmail_client.rs +++ b/src/gmail_client.rs @@ -16,6 +16,7 @@ use crate::{Credential, Error, MessageList, Result}; pub const DEFAULT_MAX_RESULTS: &str = "200"; /// Struct to capture configuration for List API call. +#[derive(Clone)] pub struct GmailClient { hub: Gmail>, label_map: BTreeMap, @@ -110,7 +111,8 @@ impl GmailClient { self.hub.clone() } - pub async fn get_messages(&self) -> Result { - MessageList::new(&self).await + /// Get the message list + pub async fn get_message_list(&self) -> Result { + MessageList::new(self).await } }