From 81f84a4ea46b8c7262b084d2940003f0feaa5df6 Mon Sep 17 00:00:00 2001 From: Thomas Bahn Date: Fri, 6 Feb 2015 15:20:06 +0100 Subject: [PATCH] Remove unneeded `mut` specifiers --- serde_macros/src/lib.rs | 2 +- src/json/ser.rs | 8 ++++---- src/ser.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/serde_macros/src/lib.rs b/serde_macros/src/lib.rs index ab8314ab..563f94a4 100644 --- a/serde_macros/src/lib.rs +++ b/serde_macros/src/lib.rs @@ -488,7 +488,7 @@ fn deserialize_static_fields( } } -fn find_serial_name<'a, I>(mut iterator: I) -> Option where +fn find_serial_name<'a, I>(iterator: I) -> Option where I: Iterator { for at in iterator { diff --git a/src/json/ser.rs b/src/json/ser.rs index 3cd9192f..6ace7f03 100644 --- a/src/json/ser.rs +++ b/src/json/ser.rs @@ -288,7 +288,7 @@ impl ser::Serializer for Serializer { fn serialize_seq< T: Serialize, IoError>, Iter: Iterator - >(&mut self, mut iter: Iter) -> IoResult<()> { + >(&mut self, iter: Iter) -> IoResult<()> { try!(self.wr.write_str("[")); let mut first = true; for elt in iter { @@ -308,7 +308,7 @@ impl ser::Serializer for Serializer { K: Serialize, IoError>, V: Serialize, IoError>, Iter: Iterator - >(&mut self, mut iter: Iter) -> IoResult<()> { + >(&mut self, iter: Iter) -> IoResult<()> { try!(self.wr.write_str("{")); let mut first = true; for (key, value) in iter { @@ -542,7 +542,7 @@ impl ser::Serializer for PrettySerializer { fn serialize_seq< T: Serialize, IoError>, Iter: Iterator - >(&mut self, mut iter: Iter) -> IoResult<()> { + >(&mut self, iter: Iter) -> IoResult<()> { try!(self.wr.write_str("[")); self.first = true; @@ -559,7 +559,7 @@ impl ser::Serializer for PrettySerializer { K: Serialize, IoError>, V: Serialize, IoError>, Iter: Iterator - >(&mut self, mut iter: Iter) -> IoResult<()> { + >(&mut self, iter: Iter) -> IoResult<()> { try!(self.wr.write_str("{")); self.first = true; diff --git a/src/ser.rs b/src/ser.rs index 590c005f..1aec3dd6 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -552,7 +552,7 @@ mod tests { fn serialize_seq< T: Serialize, Error>, SeqIter: Iterator - >(&mut self, mut iter: SeqIter) -> Result<(), Error> { + >(&mut self, iter: SeqIter) -> Result<(), Error> { let (len, _) = iter.size_hint(); try!(self.serialize(Token::SeqStart(len))); for elt in iter { @@ -565,7 +565,7 @@ mod tests { K: Serialize, Error>, V: Serialize, Error>, MapIter: Iterator - >(&mut self, mut iter: MapIter) -> Result<(), Error> { + >(&mut self, iter: MapIter) -> Result<(), Error> { let (len, _) = iter.size_hint(); try!(self.serialize(Token::MapStart(len))); for (key, value) in iter {