diff --git a/src/client/conn/http1.rs b/src/client/conn/http1.rs index 37eda04067..8e9c6a671e 100644 --- a/src/client/conn/http1.rs +++ b/src/client/conn/http1.rs @@ -250,6 +250,14 @@ impl fmt::Debug for SendRequest { } } +/// A [`SendRequest`] can be constructed from its legacy counterpart. +#[cfg_attr(feature = "deprecated", allow(deprecated))] +impl From> for SendRequest { + fn from(super::SendRequest { dispatch }: super::SendRequest) -> Self { + SendRequest { dispatch } + } +} + // ===== impl Connection impl fmt::Debug for Connection diff --git a/src/client/conn/http2.rs b/src/client/conn/http2.rs index 5697e9ee47..8e2f39ecd3 100644 --- a/src/client/conn/http2.rs +++ b/src/client/conn/http2.rs @@ -188,6 +188,16 @@ impl fmt::Debug for SendRequest { } } +/// A [`SendRequest`] can be constructed from its legacy counterpart. +#[cfg_attr(feature = "deprecated", allow(deprecated))] +impl From> for SendRequest { + fn from(super::SendRequest { dispatch }: super::SendRequest) -> Self { + Self { + dispatch: dispatch.unbound(), + } + } +} + // ===== impl Connection impl Connection