Make Value use the 'json' format string
This commit is contained in:
parent
c30311153c
commit
a1e101b513
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) });
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user