Skip to content

Commit da27ba2

Browse files
authored
Merge pull request #49 from jbr/impl-for-box
add an implementation of HttpClient for Box<dyn HttpClient>
2 parents 83b7fb0 + 6b51994 commit da27ba2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,10 @@ pub type Body = http_types::Body;
6666

6767
/// Error type.
6868
pub type Error = http_types::Error;
69+
70+
#[async_trait]
71+
impl HttpClient for Box<dyn HttpClient> {
72+
async fn send(&self, req: Request) -> Result<Response, Error> {
73+
self.send(req).await
74+
}
75+
}

0 commit comments

Comments
 (0)