Skip to content

Commit 39a0ae3

Browse files
committed
Allow passing generic bodies
1 parent f4d8e08 commit 39a0ae3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bodyt.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,12 @@ impl From<Option<Bytes>> for Body {
106106
}
107107
}
108108
}
109+
110+
impl<E> From<BoxBody<Bytes, E>> for Body
111+
where
112+
E: Into<Box<dyn std::error::Error + Send + Sync>> + Send + 'static,
113+
{
114+
fn from(body: BoxBody<Bytes, E>) -> Self {
115+
Body(body.map_err(crate::Error::new).boxed())
116+
}
117+
}

0 commit comments

Comments
 (0)