Merge pull request #63 from Ryanl92/master

Update serde to 0.7.0
This commit is contained in:
Kang Seonghoon 2016-03-04 02:21:21 +09:00
commit daf7a08ad3
5 changed files with 16 additions and 16 deletions

View File

@ -18,7 +18,7 @@ name = "chrono"
time = "0.1"
num = { version = "0.1", default-features = false }
rustc-serialize = { version = "0.3", optional = true }
serde = { version = "^0.6.0", optional = true }
serde = { version = "^0.7.0", optional = true }
[dev-dependencies]
serde_json = { version = "^0.6.0" }
serde_json = { version = "^0.7.0" }

View File

@ -383,7 +383,7 @@ mod serde {
where S: ser::Serializer
{
// Debug formatting is correct RFC3339, and it allows Zulu.
serializer.visit_str(&format!("{:?}", self))
serializer.serialize_str(&format!("{:?}", self))
}
}
@ -395,7 +395,7 @@ mod serde {
fn visit_str<E>(&mut self, value: &str) -> Result<DateTime<FixedOffset>, E>
where E: de::Error
{
value.parse().map_err(|err| E::syntax(&format!("{}", err)))
value.parse().map_err(|err| E::custom(format!("{}", err)))
}
}
@ -403,7 +403,7 @@ mod serde {
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error>
where D: de::Deserializer
{
deserializer.visit(DateTimeVisitor)
deserializer.deserialize(DateTimeVisitor)
}
}
@ -411,7 +411,7 @@ mod serde {
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error>
where D: de::Deserializer
{
deserializer.visit(DateTimeVisitor).map(|dt| dt.with_timezone(&UTC))
deserializer.deserialize(DateTimeVisitor).map(|dt| dt.with_timezone(&UTC))
}
}
@ -419,7 +419,7 @@ mod serde {
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error>
where D: de::Deserializer
{
deserializer.visit(DateTimeVisitor).map(|dt| dt.with_timezone(&Local))
deserializer.deserialize(DateTimeVisitor).map(|dt| dt.with_timezone(&Local))
}
}
}

View File

@ -1061,7 +1061,7 @@ mod serde {
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>
where S: ser::Serializer
{
serializer.visit_str(&format!("{:?}", self))
serializer.serialize_str(&format!("{:?}", self))
}
}
@ -1073,7 +1073,7 @@ mod serde {
fn visit_str<E>(&mut self, value: &str) -> Result<NaiveDate, E>
where E: de::Error
{
value.parse().map_err(|err| E::syntax(&format!("{}", err)))
value.parse().map_err(|err| E::custom(format!("{}", err)))
}
}
@ -1081,7 +1081,7 @@ mod serde {
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error>
where D: de::Deserializer
{
deserializer.visit(NaiveDateVisitor)
deserializer.deserialize(NaiveDateVisitor)
}
}
}

View File

@ -324,7 +324,7 @@ mod serde {
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>
where S: ser::Serializer
{
serializer.visit_str(&format!("{:?}", self))
serializer.serialize_str(&format!("{:?}", self))
}
}
@ -336,7 +336,7 @@ mod serde {
fn visit_str<E>(&mut self, value: &str) -> Result<NaiveDateTime, E>
where E: de::Error
{
value.parse().map_err(|err| E::syntax(&format!("{}", err)))
value.parse().map_err(|err| E::custom(format!("{}", err)))
}
}
@ -344,7 +344,7 @@ mod serde {
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error>
where D: de::Deserializer
{
deserializer.visit(NaiveDateTimeVisitor)
deserializer.deserialize(NaiveDateTimeVisitor)
}
}
}

View File

@ -583,7 +583,7 @@ mod serde {
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>
where S: ser::Serializer
{
serializer.visit_str(&format!("{:?}", self))
serializer.serialize_str(&format!("{:?}", self))
}
}
@ -595,7 +595,7 @@ mod serde {
fn visit_str<E>(&mut self, value: &str) -> Result<NaiveTime, E>
where E: de::Error
{
value.parse().map_err(|err| E::syntax(&format!("{}", err)))
value.parse().map_err(|err| E::custom(format!("{}", err)))
}
}
@ -603,7 +603,7 @@ mod serde {
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error>
where D: de::Deserializer
{
deserializer.visit(NaiveTimeVisitor)
deserializer.deserialize(NaiveTimeVisitor)
}
}
}