Make Value use the 'json' format string

This commit is contained in:
Hugo Duncan 2015-04-30 16:50:51 -04:00
parent c30311153c
commit a1e101b513
2 changed files with 4 additions and 4 deletions

View File

@ -574,7 +574,7 @@ impl ser::Serializer for Serializer {
#[inline]
fn format() -> &'static str {
"value"
"json"
}
}
@ -685,7 +685,7 @@ impl de::Deserializer for Deserializer {
#[inline]
fn format() -> &'static str {
"value"
"json"
}
}

View File

@ -1047,7 +1047,7 @@ fn test_missing_renamed_field() {
fn test_missing_fmt_renamed_field() {
#[derive(Debug, PartialEq, Deserialize)]
struct Foo {
#[serde(rename(json="y", value="z"))]
#[serde(rename(json="y"))]
x: Option<u32>,
}
@ -1061,7 +1061,7 @@ fn test_missing_fmt_renamed_field() {
assert_eq!(value, Foo { x: None });
let value : Foo = from_value(Value::Object(treemap!(
"z".to_string() => Value::I64(5)
"y".to_string() => Value::I64(5)
))).unwrap();
assert_eq!(value, Foo { x: Some(5) });
}