Skip to content

Commit 9370048

Browse files
committed
Allow passing generic bodies
1 parent 99d6dc8 commit 9370048

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bodyt.rs

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

0 commit comments

Comments
 (0)