From 53c240be2191dfc318079f25ed3980ed79c7bd79 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sat, 5 Feb 2022 22:07:53 +0100 Subject: [PATCH] Derive Copy on RequestData --- src/client.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/client.rs b/src/client.rs index 4488e5d..531bb83 100644 --- a/src/client.rs +++ b/src/client.rs @@ -180,6 +180,19 @@ impl<'c, 'e, C: Command, E: Extension> From<(&'c C, &'e E)> for RequestData<'c, } } +// Manual impl because this does not depend on whether `C` and `E` are `Clone` +impl<'c, 'e, C, E> Clone for RequestData<'c, 'e, C, E> { + fn clone(&self) -> Self { + Self { + command: self.command, + extension: self.extension, + } + } +} + +// Manual impl because this does not depend on whether `C` and `E` are `Copy` +impl<'c, 'e, C, E> Copy for RequestData<'c, 'e, C, E> {} + #[cfg(feature = "tokio-rustls")] pub struct RustlsConnector { inner: TlsConnector,