Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #468 from sfackler/split-map
Browse files Browse the repository at this point in the history
Split serialize_map_elt
  • Loading branch information
dtolnay authored Jul 27, 2016
2 parents 42f5cab + c07c563 commit d451a4d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions serde_test/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,12 @@ impl<'a, I> ser::Serializer for Serializer<'a, I>
Ok(())
}

fn serialize_map_elt<K, V>(&mut self, _: &mut (), key: K, value: V) -> Result<(), Self::Error> where K: Serialize, V: Serialize {
fn serialize_map_key<T>(&mut self, _: &mut (), key: T) -> Result<(), Self::Error> where T: Serialize {
assert_eq!(self.tokens.next(), Some(&Token::MapSep));
try!(key.serialize(self));
key.serialize(self)
}

fn serialize_map_value<T>(&mut self, _: &mut (), value: T) -> Result<(), Self::Error> where T: Serialize {
value.serialize(self)
}

Expand Down

0 comments on commit d451a4d

Please sign in to comment.