diff options
author | Daniel Lockyer <thisisdaniellockyer@gmail.com> | 2017-03-30 12:42:27 +0100 |
---|---|---|
committer | Daniel Lockyer <thisisdaniellockyer@gmail.com> | 2017-04-12 09:29:00 +0100 |
commit | d1558f78efff59b167f4ce264b18534b125f697a (patch) | |
tree | c6e0f42e06ae22d7cd00a1a42fae89fbb6a255d7 /src | |
parent | a2053c850515a0d9f45cd0a3cec9acc555117e87 (diff) | |
download | milf-rs-d1558f78efff59b167f4ce264b18534b125f697a.tar.gz milf-rs-d1558f78efff59b167f4ce264b18534b125f697a.zip |
Stop taking references when not needed
Diffstat (limited to 'src')
-rw-r--r-- | src/de.rs | 4 | ||||
-rw-r--r-- | src/ser.rs | 8 |
2 files changed, 6 insertions, 6 deletions
@@ -470,7 +470,7 @@ impl<'a> de::Deserializer for ValueDeserializer<'a> { where V: de::Visitor, { if name == SERDE_STRUCT_NAME && fields == &[SERDE_STRUCT_FIELD_NAME] { - if let Value::Datetime(ref s) = self.value { + if let Value::Datetime(s) = self.value { return visitor.visit_map(DatetimeDeserializer { date: s, visited: false, @@ -783,7 +783,7 @@ impl<'a> Deserializer<'a> { if suffix != "" { return Err(self.error(start, ErrorKind::NumberInvalid)) } - let (a, b) = self.parse_integer(&after, false, true)?; + let (a, b) = self.parse_integer(after, false, true)?; fraction = Some(a); suffix = b; } @@ -283,7 +283,7 @@ impl<'a> Serializer<'a> { if array_of_tables { self.dst.push_str("["); } - self.emit_key_part(&state)?; + self.emit_key_part(state)?; if array_of_tables { self.dst.push_str("]"); } @@ -586,10 +586,10 @@ impl<'a, 'b> ser::SerializeMap for SerializeTable<'a, 'b> { let res = value.serialize(&mut Serializer { dst: &mut *ser.dst, state: State::Table { - key: &key, + key: key, parent: &ser.state, - first: &first, - table_emitted: &table_emitted, + first: first, + table_emitted: table_emitted, }, }); match res { |