diff --git a/src/file/format/jsonc.rs b/src/file/format/jsonc.rs index c5be8200..14b14f9c 100644 --- a/src/file/format/jsonc.rs +++ b/src/file/format/jsonc.rs @@ -32,15 +32,15 @@ fn from_jsonc_value(uri: Option<&String>, value: JsonValue) -> Value { let vk = match value { JsonValue::Null => ValueKind::Nil, JsonValue::String(v) => ValueKind::String(v.to_string()), - JsonValue::Number(ref value) => { - if let Ok(value) = value.parse::() { - ValueKind::I64(value) - } else if let Ok(value) = value.parse::() { - ValueKind::Float(value) + JsonValue::Number(number) => { + if let Ok(v) = number.parse::() { + ValueKind::I64(v) + } else if let Ok(v) = number.parse::() { + ValueKind::Float(v) } else { unreachable!(); } - }, + } JsonValue::Boolean(v) => ValueKind::Boolean(v), JsonValue::Object(table) => { let m = table diff --git a/tests/file_jsonc.rs b/tests/file_jsonc.rs index 80aec72e..56b36234 100644 --- a/tests/file_jsonc.rs +++ b/tests/file_jsonc.rs @@ -52,7 +52,7 @@ fn test_file() { assert_eq!(s.place.telephone, None); assert_eq!(s.elements.len(), 10); assert_eq!(s.elements[3], "4".to_string()); - if cfg!(feature = "preserve_order") { + if cfg!(feature = "TODO: preserve_order") { assert_eq!( s.place .creator