🎨 style(message-list): apply rustfmt to satisfy CI fmt check
This commit is contained in:
committed by
Jeremiah Russell
parent
0042ba271f
commit
b878ff6152
@@ -60,7 +60,6 @@ use google_gmail1::{
|
|||||||
hyper_util::client::legacy::connect::HttpConnector,
|
hyper_util::client::legacy::connect::HttpConnector,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// A trait for interacting with Gmail message lists, providing methods for
|
/// A trait for interacting with Gmail message lists, providing methods for
|
||||||
/// retrieving, filtering, and managing collections of Gmail messages.
|
/// retrieving, filtering, and managing collections of Gmail messages.
|
||||||
///
|
///
|
||||||
@@ -555,20 +554,45 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl MessageList for MockList {
|
impl MessageList for MockList {
|
||||||
async fn log_messages(&mut self) -> Result<()> { Ok(()) }
|
async fn log_messages(&mut self) -> Result<()> {
|
||||||
async fn list_messages(&mut self, _next_page_token: Option<String>) -> Result<ListMessagesResponse> { Ok(ListMessagesResponse::default()) }
|
Ok(())
|
||||||
async fn get_messages(&mut self, _pages: u32) -> Result<()> { Ok(()) }
|
}
|
||||||
fn hub(&self) -> Gmail<HttpsConnector<HttpConnector>> { panic!("not used in tests") }
|
async fn list_messages(
|
||||||
fn label_ids(&self) -> Vec<String> { self.label_ids.clone() }
|
&mut self,
|
||||||
|
_next_page_token: Option<String>,
|
||||||
|
) -> Result<ListMessagesResponse> {
|
||||||
|
Ok(ListMessagesResponse::default())
|
||||||
|
}
|
||||||
|
async fn get_messages(&mut self, _pages: u32) -> Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
fn hub(&self) -> Gmail<HttpsConnector<HttpConnector>> {
|
||||||
|
panic!("not used in tests")
|
||||||
|
}
|
||||||
|
fn label_ids(&self) -> Vec<String> {
|
||||||
|
self.label_ids.clone()
|
||||||
|
}
|
||||||
fn message_ids(&self) -> Vec<String> {
|
fn message_ids(&self) -> Vec<String> {
|
||||||
self.messages.iter().map(|m| m.id().to_string()).collect()
|
self.messages.iter().map(|m| m.id().to_string()).collect()
|
||||||
}
|
}
|
||||||
fn messages(&self) -> &Vec<MessageSummary> { &self.messages }
|
fn messages(&self) -> &Vec<MessageSummary> {
|
||||||
fn set_query(&mut self, query: &str) { self.query = query.to_string(); }
|
&self.messages
|
||||||
fn add_labels_ids(&mut self, label_ids: &[String]) { self.label_ids.extend_from_slice(label_ids); }
|
}
|
||||||
fn add_labels(&mut self, _labels: &[String]) -> Result<()> { Ok(()) }
|
fn set_query(&mut self, query: &str) {
|
||||||
fn max_results(&self) -> u32 { self.max_results }
|
self.query = query.to_string();
|
||||||
fn set_max_results(&mut self, value: u32) { self.max_results = value; }
|
}
|
||||||
|
fn add_labels_ids(&mut self, label_ids: &[String]) {
|
||||||
|
self.label_ids.extend_from_slice(label_ids);
|
||||||
|
}
|
||||||
|
fn add_labels(&mut self, _labels: &[String]) -> Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
fn max_results(&self) -> u32 {
|
||||||
|
self.max_results
|
||||||
|
}
|
||||||
|
fn set_max_results(&mut self, value: u32) {
|
||||||
|
self.max_results = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user