From 69d48c4be7ceac92a1bcf5570a1bc8696cede279 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Mon, 31 Aug 2020 18:28:43 +0200 Subject: [PATCH] Don't require Transport::{Ok, Error} to inherit specific traits --- src/lib.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ffbf098..2a97576 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,7 +59,6 @@ pub use crate::{address::Address, transport::stub::StubTransport}; use async_trait::async_trait; #[cfg(feature = "builder")] use std::convert::TryFrom; -use std::{error::Error as StdError, fmt}; /// Simple email envelope representation /// @@ -139,9 +138,10 @@ impl TryFrom<&Headers> for Envelope { /// Blocking Transport method for emails pub trait Transport { - /// Result types for the transport - type Ok: fmt::Debug; - type Error: StdError; + /// Response produced by the Transport + type Ok; + /// Error produced by the Transport + type Error; /// Sends the email #[cfg(feature = "builder")] @@ -157,9 +157,10 @@ pub trait Transport { #[cfg(feature = "async-std1")] #[async_trait] pub trait AsyncStd1Transport { - /// Result types for the transport - type Ok: fmt::Debug; - type Error: StdError; + /// Response produced by the Transport + type Ok; + /// Error produced by the Transport + type Error; /// Sends the email #[cfg(feature = "builder")] @@ -177,9 +178,10 @@ pub trait AsyncStd1Transport { #[cfg(feature = "tokio02")] #[async_trait] pub trait Tokio02Transport { - /// Result types for the transport - type Ok: fmt::Debug; - type Error: StdError; + /// Response produced by the Transport + type Ok; + /// Error produced by the Transport + type Error; /// Sends the email #[cfg(feature = "builder")]