From e1462b2d1bbac2f5fda17b7a0ecbc956494f5890 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Thu, 24 Mar 2022 06:52:28 +0100 Subject: [PATCH] Bump MSRV to 1.56 - Edition 2021 (#745) --- .github/workflows/test.yml | 4 ++-- CHANGELOG.md | 2 +- Cargo.toml | 5 +++-- README.md | 2 +- src/address/envelope.rs | 3 --- src/address/types.rs | 1 - src/lib.rs | 4 +--- src/message/mailbox/types.rs | 1 - src/message/mod.rs | 2 +- src/transport/smtp/client/async_net.rs | 4 ---- src/transport/smtp/client/net.rs | 2 -- 11 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4324eb3..563c4ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,8 +81,8 @@ jobs: rust: stable - name: beta rust: beta - - name: 1.53.0 - rust: 1.53.0 + - name: 1.56.0 + rust: 1.56.0 steps: - name: Checkout diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bc24eb..33ff699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Several breaking changes were made between 0.9 and 0.10, but changes should be straightforward: -* MSRV is now 1.53.0 +* MSRV is now 1.56.0 * The `lettre_email` crate has been merged into `lettre`. To migrate, replace `lettre_email` with `lettre::message` and make sure to enable the `builder` feature (it's enabled by default). * `SendableEmail` has been renamed to `Email` and `EmailBuilder::build()` produces it directly. To migrate, diff --git a/Cargo.toml b/Cargo.toml index d71096f..9cc8382 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,8 @@ license = "MIT" authors = ["Alexis Mousset ", "Paolo Barbolini "] categories = ["email", "network-programming"] keywords = ["email", "smtp", "mailer", "message", "sendmail"] -edition = "2018" +edition = "2021" +rust-version = "1.56" [badges] is-it-maintained-issue-resolution = { repository = "lettre/lettre" } @@ -57,7 +58,7 @@ async-std = { version = "1.8", optional = true, features = ["unstable"] } futures-rustls = { version = "0.22", optional = true } ## tokio -tokio1_crate = { package = "tokio", version = "1", features = ["fs", "process", "time", "net", "io-util"], optional = true } +tokio1_crate = { package = "tokio", version = "1", features = ["fs", "rt", "process", "time", "net", "io-util"], optional = true } tokio1_native_tls_crate = { package = "tokio-native-tls", version = "0.3", optional = true } tokio1_rustls = { package = "tokio-rustls", version = "0.23", optional = true } diff --git a/README.md b/README.md index 5e6c086..2829ac8 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Lettre does not provide (for now): ## Example -This library requires Rust 1.53.0 or newer. +This library requires Rust 1.56.0 or newer. To use this library, add the following to your `Cargo.toml`: diff --git a/src/address/envelope.rs b/src/address/envelope.rs index 07749a4..65fb090 100644 --- a/src/address/envelope.rs +++ b/src/address/envelope.rs @@ -1,6 +1,3 @@ -#[cfg(feature = "builder")] -use std::convert::TryFrom; - use super::Address; #[cfg(feature = "builder")] use crate::message::header::{self, Headers}; diff --git a/src/address/types.rs b/src/address/types.rs index 36c9d4a..45bdbd2 100644 --- a/src/address/types.rs +++ b/src/address/types.rs @@ -1,7 +1,6 @@ //! Representation of an email address use std::{ - convert::{TryFrom, TryInto}, error::Error, ffi::OsStr, fmt::{Display, Formatter, Result as FmtResult}, diff --git a/src/lib.rs b/src/lib.rs index d5223df..4cc25b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,7 @@ //! * Secure defaults //! * Async support //! -//! Lettre requires Rust 1.52.1 or newer. +//! Lettre requires Rust 1.56.0 or newer. //! //! ## Features //! @@ -224,8 +224,6 @@ pub(crate) type BoxError = Box; #[cfg(test)] #[cfg(feature = "builder")] mod test { - use std::convert::TryFrom; - use super::*; use crate::message::{header, header::Headers, Mailbox, Mailboxes}; diff --git a/src/message/mailbox/types.rs b/src/message/mailbox/types.rs index b2aa8dc..abbf1db 100644 --- a/src/message/mailbox/types.rs +++ b/src/message/mailbox/types.rs @@ -1,5 +1,4 @@ use std::{ - convert::TryFrom, fmt::{Display, Formatter, Result as FmtResult, Write}, mem, slice::Iter, diff --git a/src/message/mod.rs b/src/message/mod.rs index 6608abf..1d02163 100644 --- a/src/message/mod.rs +++ b/src/message/mod.rs @@ -196,7 +196,7 @@ //! ``` //! -use std::{convert::TryFrom, io::Write, iter, time::SystemTime}; +use std::{io::Write, iter, time::SystemTime}; pub use attachment::Attachment; pub use body::{Body, IntoBody, MaybeString}; diff --git a/src/transport/smtp/client/async_net.rs b/src/transport/smtp/client/async_net.rs index bf4e201..3786a7e 100644 --- a/src/transport/smtp/client/async_net.rs +++ b/src/transport/smtp/client/async_net.rs @@ -287,8 +287,6 @@ impl AsyncNetworkStream { #[cfg(feature = "tokio1-rustls-tls")] return { - use std::convert::TryFrom; - use rustls::ServerName; use tokio1_rustls::TlsConnector; @@ -342,8 +340,6 @@ impl AsyncNetworkStream { #[cfg(feature = "async-std1-rustls-tls")] return { - use std::convert::TryFrom; - use futures_rustls::TlsConnector; use rustls::ServerName; diff --git a/src/transport/smtp/client/net.rs b/src/transport/smtp/client/net.rs index d6bed0e..dc63726 100644 --- a/src/transport/smtp/client/net.rs +++ b/src/transport/smtp/client/net.rs @@ -1,5 +1,3 @@ -#[cfg(feature = "rustls-tls")] -use std::convert::TryFrom; use std::{ io::{self, Read, Write}, mem,