diff --git a/src/ser/impls.rs b/src/ser/impls.rs index babfa5ea..75200cf6 100644 --- a/src/ser/impls.rs +++ b/src/ser/impls.rs @@ -44,12 +44,12 @@ impl_visit!(char, visit_char); /////////////////////////////////////////////////////////////////////////////// -impl<'a> Serialize for &'a str { +impl Serialize for str { #[inline] fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer, { - serializer.visit_str(*self) + serializer.visit_str(self) } } @@ -426,7 +426,7 @@ impl Serialize for VecMap /////////////////////////////////////////////////////////////////////////////// -impl<'a, T> Serialize for &'a T where T: Serialize { +impl<'a, T: ?Sized> Serialize for &'a T where T: Serialize { #[inline] fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer, @@ -435,7 +435,7 @@ impl<'a, T> Serialize for &'a T where T: Serialize { } } -impl<'a, T> Serialize for &'a mut T where T: Serialize { +impl<'a, T: ?Sized> Serialize for &'a mut T where T: Serialize { #[inline] fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer, @@ -444,7 +444,7 @@ impl<'a, T> Serialize for &'a mut T where T: Serialize { } } -impl Serialize for Box where T: Serialize { +impl Serialize for Box where T: Serialize { #[inline] fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer,