aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Lockyer <thisisdaniellockyer@gmail.com>2017-03-30 12:42:27 +0100
committerDaniel Lockyer <thisisdaniellockyer@gmail.com>2017-04-12 09:29:00 +0100
commitd1558f78efff59b167f4ce264b18534b125f697a (patch)
treec6e0f42e06ae22d7cd00a1a42fae89fbb6a255d7 /src
parenta2053c850515a0d9f45cd0a3cec9acc555117e87 (diff)
downloadmilf-rs-d1558f78efff59b167f4ce264b18534b125f697a.tar.gz
milf-rs-d1558f78efff59b167f4ce264b18534b125f697a.zip
Stop taking references when not needed
Diffstat (limited to 'src')
-rw-r--r--src/de.rs4
-rw-r--r--src/ser.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/de.rs b/src/de.rs
index 0022791..13a3d90 100644
--- a/src/de.rs
+++ b/src/de.rs
@@ -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;
}
diff --git a/src/ser.rs b/src/ser.rs
index bc5f357..8fcf0eb 100644
--- a/src/ser.rs
+++ b/src/ser.rs
@@ -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 {