diff --git a/http/src/body.rs b/http/src/body.rs index 3113a0cc..e0458655 100644 --- a/http/src/body.rs +++ b/http/src/body.rs @@ -71,6 +71,12 @@ impl Stream for RequestBody { } } +impl From> for RequestBody { + fn from(_: NoneBody) -> Self { + Self::None + } +} + impl From for RequestBody { fn from(bytes: Bytes) -> Self { Self::from(Once::new(bytes)) @@ -430,7 +436,7 @@ res_bytes_impl!(String); impl From> for ResponseBody { fn from(str: Box) -> Self { - Self::from(String::from(str)) + Self::from(Box::<[u8]>::from(str)) } }