diff --git a/Cargo.toml b/Cargo.toml index 72209adc..e7be744e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-web" -version = "0.1.0" +version = "0.2.0" authors = ["Nikolay Kim "] description = "Actix web framework" readme = "README.md" diff --git a/src/body.rs b/src/body.rs index adfb533a..c4ce4a08 100644 --- a/src/body.rs +++ b/src/body.rs @@ -113,12 +113,24 @@ impl From> for BinaryBody { } } +impl<'a> From<&'a Rc> for BinaryBody { + fn from(body: &'a Rc) -> BinaryBody { + BinaryBody::SharedBytes(Rc::clone(body)) + } +} + impl From> for BinaryBody { fn from(body: Arc) -> BinaryBody { BinaryBody::ArcSharedBytes(body) } } +impl<'a> From<&'a Arc> for BinaryBody { + fn from(body: &'a Arc) -> BinaryBody { + BinaryBody::ArcSharedBytes(Arc::clone(body)) + } +} + impl AsRef<[u8]> for BinaryBody { fn as_ref(&self) -> &[u8] { match self {