From edef4af40f6f7799159f3b8cc88092d2db988ca0 Mon Sep 17 00:00:00 2001 From: Ayala Shachar Date: Fri, 4 Oct 2024 17:34:08 +0300 Subject: [PATCH 1/2] Update Rust edition: 2018 -> 2021 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2460909..0803d14 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Rotem Yaari "] -edition = "2018" +edition = "2021" name = "mailboxer" version = "2.0.1" From 5fd6baa12c5162aff9a3b4c138b2079744355fec Mon Sep 17 00:00:00 2001 From: Ayala Shachar Date: Fri, 4 Oct 2024 17:34:56 +0300 Subject: [PATCH 2/2] Clippy fix --- src/pagination.rs | 2 +- src/smtp.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pagination.rs b/src/pagination.rs index bf56ce4..fa52110 100644 --- a/src/pagination.rs +++ b/src/pagination.rs @@ -9,7 +9,7 @@ pub struct Pagination { impl Pagination { pub fn get_page(&self) -> usize { - max(1, self.page.unwrap_or(1) as usize) + max(1, self.page.unwrap_or(1)) } pub fn limit(&self) -> i64 { diff --git a/src/smtp.rs b/src/smtp.rs index 1517fce..8b84208 100644 --- a/src/smtp.rs +++ b/src/smtp.rs @@ -316,6 +316,11 @@ fn read_to_end_of_data(stream: &mut dyn BufRead) -> Result { } } +fn load_tls_identity() -> Identity { + Identity::from_pkcs12(include_bytes!("../tls_identity.pfx"), "mailboxer") + .expect("Unable to load identity") +} + #[cfg(test)] mod tests { @@ -365,8 +370,3 @@ mod tests { ); } } - -fn load_tls_identity() -> Identity { - Identity::from_pkcs12(include_bytes!("../tls_identity.pfx"), "mailboxer") - .expect("Unable to load identity") -}