From 1fcff673ba82f9f2923bac4e408c29d9c5d97a35 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Thu, 3 Apr 2025 10:05:39 +0200 Subject: [PATCH] fix: remove `E: Clone` bound from `AsyncFileTransport` `Clone` impl (#1075) --- src/transport/file/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/transport/file/mod.rs b/src/transport/file/mod.rs index 6a4f480..5ec0605 100644 --- a/src/transport/file/mod.rs +++ b/src/transport/file/mod.rs @@ -173,7 +173,7 @@ pub struct FileTransport { } /// Asynchronously writes the content and the envelope information to a file -#[derive(Debug, Clone)] +#[derive(Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(docsrs, doc(cfg(any(feature = "tokio1", feature = "async-std1"))))] #[cfg(any(feature = "async-std1", feature = "tokio1"))] @@ -272,6 +272,16 @@ where } } +#[cfg(any(feature = "async-std1", feature = "tokio1"))] +impl Clone for AsyncFileTransport { + fn clone(&self) -> Self { + Self { + inner: self.inner.clone(), + marker_: PhantomData, + } + } +} + impl Transport for FileTransport { type Ok = Id; type Error = Error;