style(all): use serde derive feature
The serde docs suggest using the `derive` feature instead of importing `serde_derive` directly: https://serde.rs/derive.html
This commit is contained in:
@@ -26,9 +26,8 @@ bufstream = { version = "^0.1", optional = true }
|
|||||||
native-tls = { version = "^0.2", optional = true }
|
native-tls = { version = "^0.2", optional = true }
|
||||||
base64 = { version = "^0.11", optional = true }
|
base64 = { version = "^0.11", optional = true }
|
||||||
hostname = { version = "^0.2", optional = true }
|
hostname = { version = "^0.2", optional = true }
|
||||||
serde = { version = "^1.0", optional = true }
|
serde = { version = "^1.0", optional = true, features = ["derive"] }
|
||||||
serde_json = { version = "^1.0", optional = true }
|
serde_json = { version = "^1.0", optional = true }
|
||||||
serde_derive = { version = "^1.0", optional = true }
|
|
||||||
fast_chemail = "^0.9"
|
fast_chemail = "^0.9"
|
||||||
r2d2 = { version = "^0.8", optional = true}
|
r2d2 = { version = "^0.8", optional = true}
|
||||||
|
|
||||||
@@ -44,7 +43,7 @@ harness = false
|
|||||||
[features]
|
[features]
|
||||||
default = ["file-transport", "smtp-transport", "sendmail-transport"]
|
default = ["file-transport", "smtp-transport", "sendmail-transport"]
|
||||||
unstable = []
|
unstable = []
|
||||||
serde-impls = ["serde", "serde_derive"]
|
serde-impls = ["serde"]
|
||||||
file-transport = ["serde-impls", "serde_json"]
|
file-transport = ["serde-impls", "serde_json"]
|
||||||
smtp-transport = ["bufstream", "native-tls", "base64", "nom", "hostname"]
|
smtp-transport = ["bufstream", "native-tls", "base64", "nom", "hostname"]
|
||||||
sendmail-transport = []
|
sendmail-transport = []
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ pub mod error;
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct FileTransport {
|
pub struct FileTransport {
|
||||||
path: PathBuf,
|
path: PathBuf,
|
||||||
@@ -36,7 +36,7 @@ impl FileTransport {
|
|||||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
struct SerializableEmail {
|
struct SerializableEmail {
|
||||||
envelope: Envelope,
|
envelope: Envelope,
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ use std::str::FromStr;
|
|||||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct EmailAddress(String);
|
pub struct EmailAddress(String);
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ impl AsRef<OsStr> for EmailAddress {
|
|||||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct Envelope {
|
pub struct Envelope {
|
||||||
/// The envelope recipients' addresses
|
/// The envelope recipients' addresses
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ pub mod error;
|
|||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct SendmailTransport {
|
pub struct SendmailTransport {
|
||||||
command: String,
|
command: String,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ impl<S: Into<String>, T: Into<String>> IntoCredentials for (S, T) {
|
|||||||
#[derive(PartialEq, Eq, Clone, Hash, Debug)]
|
#[derive(PartialEq, Eq, Clone, Hash, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct Credentials {
|
pub struct Credentials {
|
||||||
authentication_identity: String,
|
authentication_identity: String,
|
||||||
@@ -54,7 +54,7 @@ impl Credentials {
|
|||||||
#[derive(PartialEq, Eq, Copy, Clone, Hash, Debug)]
|
#[derive(PartialEq, Eq, Copy, Clone, Hash, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum Mechanism {
|
pub enum Mechanism {
|
||||||
/// PLAIN authentication mechanism
|
/// PLAIN authentication mechanism
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ pub mod net;
|
|||||||
#[derive(Default, Clone, Copy, Debug)]
|
#[derive(Default, Clone, Copy, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct ClientCodec {
|
pub struct ClientCodec {
|
||||||
escape_count: u8,
|
escape_count: u8,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use std::fmt::{self, Display, Formatter};
|
|||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct EhloCommand {
|
pub struct EhloCommand {
|
||||||
client_id: ClientId,
|
client_id: ClientId,
|
||||||
@@ -38,7 +38,7 @@ impl EhloCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug, Copy)]
|
#[derive(PartialEq, Clone, Debug, Copy)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct StarttlsCommand;
|
pub struct StarttlsCommand;
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ impl Display for StarttlsCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct MailCommand {
|
pub struct MailCommand {
|
||||||
sender: Option<EmailAddress>,
|
sender: Option<EmailAddress>,
|
||||||
@@ -84,7 +84,7 @@ impl MailCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct RcptCommand {
|
pub struct RcptCommand {
|
||||||
recipient: EmailAddress,
|
recipient: EmailAddress,
|
||||||
@@ -115,7 +115,7 @@ impl RcptCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug, Copy)]
|
#[derive(PartialEq, Clone, Debug, Copy)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct DataCommand;
|
pub struct DataCommand;
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ impl Display for DataCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug, Copy)]
|
#[derive(PartialEq, Clone, Debug, Copy)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct QuitCommand;
|
pub struct QuitCommand;
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ impl Display for QuitCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug, Copy)]
|
#[derive(PartialEq, Clone, Debug, Copy)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct NoopCommand;
|
pub struct NoopCommand;
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ impl Display for NoopCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct HelpCommand {
|
pub struct HelpCommand {
|
||||||
argument: Option<String>,
|
argument: Option<String>,
|
||||||
@@ -184,7 +184,7 @@ impl HelpCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct VrfyCommand {
|
pub struct VrfyCommand {
|
||||||
argument: String,
|
argument: String,
|
||||||
@@ -208,7 +208,7 @@ impl VrfyCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct ExpnCommand {
|
pub struct ExpnCommand {
|
||||||
argument: String,
|
argument: String,
|
||||||
@@ -231,7 +231,7 @@ impl ExpnCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug, Copy)]
|
#[derive(PartialEq, Clone, Debug, Copy)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct RsetCommand;
|
pub struct RsetCommand;
|
||||||
|
|
||||||
@@ -245,7 +245,7 @@ impl Display for RsetCommand {
|
|||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct AuthCommand {
|
pub struct AuthCommand {
|
||||||
mechanism: Mechanism,
|
mechanism: Mechanism,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const DEFAULT_DOMAIN_CLIENT_ID: &str = "localhost";
|
|||||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum ClientId {
|
pub enum ClientId {
|
||||||
/// A fully-qualified domain name
|
/// A fully-qualified domain name
|
||||||
@@ -59,7 +59,7 @@ impl ClientId {
|
|||||||
#[derive(PartialEq, Eq, Hash, Copy, Clone, Debug)]
|
#[derive(PartialEq, Eq, Hash, Copy, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum Extension {
|
pub enum Extension {
|
||||||
/// 8BITMIME keyword
|
/// 8BITMIME keyword
|
||||||
@@ -93,7 +93,7 @@ impl Display for Extension {
|
|||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct ServerInfo {
|
pub struct ServerInfo {
|
||||||
/// Server name
|
/// Server name
|
||||||
@@ -189,7 +189,7 @@ impl ServerInfo {
|
|||||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum MailParameter {
|
pub enum MailParameter {
|
||||||
/// `BODY` parameter
|
/// `BODY` parameter
|
||||||
@@ -229,7 +229,7 @@ impl Display for MailParameter {
|
|||||||
#[derive(PartialEq, Eq, Clone, Debug, Copy)]
|
#[derive(PartialEq, Eq, Clone, Debug, Copy)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum MailBodyParameter {
|
pub enum MailBodyParameter {
|
||||||
/// `7BIT`
|
/// `7BIT`
|
||||||
@@ -251,7 +251,7 @@ impl Display for MailBodyParameter {
|
|||||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum RcptParameter {
|
pub enum RcptParameter {
|
||||||
/// Custom parameter
|
/// Custom parameter
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ pub enum ClientSecurity {
|
|||||||
#[derive(Clone, Debug, Copy)]
|
#[derive(Clone, Debug, Copy)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum ConnectionReuseParameters {
|
pub enum ConnectionReuseParameters {
|
||||||
/// Unlimited connection reuse
|
/// Unlimited connection reuse
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ use std::string::ToString;
|
|||||||
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum Severity {
|
pub enum Severity {
|
||||||
/// 2yx
|
/// 2yx
|
||||||
@@ -42,7 +42,7 @@ impl Display for Severity {
|
|||||||
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum Category {
|
pub enum Category {
|
||||||
/// x0z
|
/// x0z
|
||||||
@@ -69,7 +69,7 @@ impl Display for Category {
|
|||||||
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum Detail {
|
pub enum Detail {
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
@@ -104,7 +104,7 @@ impl Display for Detail {
|
|||||||
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct Code {
|
pub struct Code {
|
||||||
/// First digit of the response code
|
/// First digit of the response code
|
||||||
@@ -138,7 +138,7 @@ impl Code {
|
|||||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct Response {
|
pub struct Response {
|
||||||
/// Response code
|
/// Response code
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use std::fmt::{Display, Formatter, Result as FmtResult};
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serde-impls",
|
feature = "serde-impls",
|
||||||
derive(serde_derive::Serialize, serde_derive::Deserialize)
|
derive(serde::Serialize, serde::Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct XText<'a>(pub &'a str);
|
pub struct XText<'a>(pub &'a str);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user