Add From<Bytes> for blocking::Body (#1114)

This commit is contained in:
varoonp123
2020-12-15 10:22:44 -05:00
committed by GitHub
parent 5099192b92
commit 73990a7a42
2 changed files with 24 additions and 0 deletions

View File

@@ -203,6 +203,14 @@ impl From<File> for Body {
}
}
}
impl From<Bytes> for Body {
#[inline]
fn from(b: Bytes) -> Body {
Body {
kind: Kind::Bytes(b),
}
}
}
impl fmt::Debug for Kind {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {