diff --git a/Cargo.toml b/Cargo.toml index 20f3afc..51da01e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,9 +16,9 @@ readme = "README.md" chrono = "0.2.17" hyper = "0.7.0" rustc-serialize = "0.3.16" -serde = "0.6.1" +serde = "0.7.0" url = "0.5.0" [dev-dependencies] -serde_json = "0.6.0" +serde_json = "0.7.0" yup-hyper-mock = "1.3.2" diff --git a/src/token/bearer.rs b/src/token/bearer.rs index 94fd964..77210ca 100644 --- a/src/token/bearer.rs +++ b/src/token/bearer.rs @@ -64,7 +64,7 @@ impl FromResponse for Bearer { impl Serialize for Bearer { fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> { - serializer.visit_struct("Bearer", SerVisitor(self, 0)) + serializer.serialize_struct("Bearer", SerVisitor(self, 0)) } } @@ -73,9 +73,9 @@ impl<'a, L: Lifetime + Serialize + 'a> ser::MapVisitor for SerVisitor<'a, L> { fn visit(&mut self, serializer: &mut S) -> Result, S::Error> { self.1 += 1; match self.1 { - 1 => serializer.visit_struct_elt("access_token", &self.0.access_token).map(Some), - 2 => serializer.visit_struct_elt("scope", &self.0.scope).map(Some), - 3 => serializer.visit_struct_elt("lifetime", &self.0.lifetime).map(Some), + 1 => serializer.serialize_struct_elt("access_token", &self.0.access_token).map(Some), + 2 => serializer.serialize_struct_elt("scope", &self.0.scope).map(Some), + 3 => serializer.serialize_struct_elt("lifetime", &self.0.lifetime).map(Some), _ => Ok(None), } } @@ -86,7 +86,7 @@ impl<'a, L: Lifetime + Serialize + 'a> ser::MapVisitor for SerVisitor<'a, L> { impl Deserialize for Bearer { fn deserialize(deserializer: &mut D) -> Result { static FIELDS: &'static [&'static str] = &["access_token", "scope", "lifetime"]; - deserializer.visit_struct("Bearer", FIELDS, DeVisitor(PhantomData)) + deserializer.deserialize_struct("Bearer", FIELDS, DeVisitor(PhantomData)) } } @@ -135,7 +135,7 @@ enum Field { impl Deserialize for Field { fn deserialize(deserializer: &mut D) -> Result { - deserializer.visit(FieldVisitor) + deserializer.deserialize(FieldVisitor) } } @@ -148,7 +148,7 @@ impl de::Visitor for FieldVisitor { "access_token" => Ok(Field::AccessToken), "scope" => Ok(Field::Scope), "lifetime" => Ok(Field::Lifetime), - _ => Err(de::Error::syntax("expected access_token, scope or lifetime")), + _ => Err(de::Error::custom("expected access_token, scope or lifetime")), } } } diff --git a/src/token/expiring.rs b/src/token/expiring.rs index 5fb15c6..6872843 100644 --- a/src/token/expiring.rs +++ b/src/token/expiring.rs @@ -95,7 +95,7 @@ impl Decodable for Expiring { impl Serialize for Expiring { fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> { - serializer.visit_struct("Expiring", SerVisitor(self, 0)) + serializer.serialize_struct("Expiring", SerVisitor(self, 0)) } } @@ -104,8 +104,8 @@ impl<'a> ser::MapVisitor for SerVisitor<'a> { fn visit(&mut self, serializer: &mut S) -> Result, S::Error> { self.1 += 1; match self.1 { - 1 => serializer.visit_struct_elt("refresh_token", &self.0.refresh_token).map(Some), - 2 => serializer.visit_struct_elt("expires", &self.0.expires.timestamp()).map(Some), + 1 => serializer.serialize_struct_elt("refresh_token", &self.0.refresh_token).map(Some), + 2 => serializer.serialize_struct_elt("expires", &self.0.expires.timestamp()).map(Some), _ => Ok(None), } } @@ -116,7 +116,7 @@ impl<'a> ser::MapVisitor for SerVisitor<'a> { impl Deserialize for Expiring { fn deserialize(deserializer: &mut D) -> Result { static FIELDS: &'static [&'static str] = &["refresh_token", "expires"]; - deserializer.visit_struct("Expiring", FIELDS, DeVisitor) + deserializer.deserialize_struct("Expiring", FIELDS, DeVisitor) } } @@ -161,7 +161,7 @@ enum Field { impl Deserialize for Field { fn deserialize(deserializer: &mut D) -> Result { - deserializer.visit(FieldVisitor) + deserializer.deserialize(FieldVisitor) } } @@ -173,7 +173,7 @@ impl de::Visitor for FieldVisitor { match value { "refresh_token" => Ok(Field::RefreshToken), "expires" => Ok(Field::Expires), - _ => Err(de::Error::syntax("expected refresh_token or expires")), + _ => Err(de::Error::custom("expected refresh_token or expires")), } } } diff --git a/src/token/statik.rs b/src/token/statik.rs index f95c751..7718716 100644 --- a/src/token/statik.rs +++ b/src/token/statik.rs @@ -25,13 +25,13 @@ impl FromResponse for Static { impl Serialize for Static { fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> { - serializer.visit_unit_struct("Static") + serializer.serialize_unit_struct("Static") } } impl Deserialize for Static { fn deserialize(deserializer: &mut D) -> Result { - deserializer.visit_unit_struct("Static", UnitVisitor) + deserializer.deserialize_unit_struct("Static", UnitVisitor) .and(Ok(Static)) } }