From 4efca7e56ab195bbc0dfee5dab90011715e1280c Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sat, 17 Jan 2015 16:32:58 -0800 Subject: [PATCH] wip --- serde2/src/de.rs | 12 ++++++------ serde2/src/ser.rs | 10 ++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/serde2/src/de.rs b/serde2/src/de.rs index 4f6be69b..82994079 100644 --- a/serde2/src/de.rs +++ b/serde2/src/de.rs @@ -1,6 +1,5 @@ use std::collections::{HashMap, BTreeMap}; -use std::collections::hash_map::Hasher; -use std::hash::Hash; +use std::hash::{Hash, Hasher}; use std::num::FromPrimitive; use std::str; @@ -595,11 +594,12 @@ tuple_impls! { /////////////////////////////////////////////////////////////////////////////// -struct HashMapVisitor; +struct HashMapVisitor; -impl Visitor for HashMapVisitor - where K: Deserialize + Eq + Hash, - V: Deserialize +impl Visitor for HashMapVisitor + where K: Deserialize + Eq + Hash, + V: Deserialize, + H: Hasher, { type Value = HashMap; diff --git a/serde2/src/ser.rs b/serde2/src/ser.rs index 90270aa9..dfa63def 100644 --- a/serde2/src/ser.rs +++ b/serde2/src/ser.rs @@ -586,10 +586,7 @@ impl Serialize for HashMap /////////////////////////////////////////////////////////////////////////////// -impl< - 'a, - T: Serialize, -> Serialize for &'a T { +impl<'a, T> Serialize for &'a T where T: Serialize { #[inline] fn visit< V: Visitor, @@ -598,10 +595,7 @@ impl< } } -impl< - 'a, - T: Serialize, -> Serialize for Box { +impl<'a, T> Serialize for Box where T: Serialize { #[inline] fn visit< V: Visitor,