diff --git a/perlmod/src/ser.rs b/perlmod/src/ser.rs index 06f5d44..dddfa10 100644 --- a/perlmod/src/ser.rs +++ b/perlmod/src/ser.rs @@ -167,7 +167,7 @@ impl<'a> ser::Serializer for &'a mut Serializer { let value = value.serialize(&mut Serializer)?; let hash = hash::Hash::new(); hash.insert(variant, value); - Ok(Value::from(hash)) + Ok(Value::new_ref(&hash)) } fn serialize_seq(self, len: Option) -> Result { @@ -554,7 +554,7 @@ impl ser::SerializeTupleVariant for SerVariant { } fn end(self) -> Result { - Ok(Value::new_ref(&self.inner.array)) + Ok(Value::new_ref(&self.hash)) } }