Merge pull request #542 from pmeredit/topic/fix_from_json_null

Fix from_json to use Nothing for Json::Null
This commit is contained in:
Jonathan Turner 2019-08-31 10:11:49 +12:00 committed by GitHub
commit 4cde96bcc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,9 +32,7 @@ fn convert_json_value_to_nu_value(v: &serde_hjson::Value, tag: impl Into<Tag>) -
let tag = tag.into(); let tag = tag.into();
match v { match v {
serde_hjson::Value::Null => { serde_hjson::Value::Null => Value::Primitive(Primitive::Nothing).tagged(tag),
Value::Primitive(Primitive::String(String::from(""))).tagged(tag)
}
serde_hjson::Value::Bool(b) => Value::Primitive(Primitive::Boolean(*b)).tagged(tag), serde_hjson::Value::Bool(b) => Value::Primitive(Primitive::Boolean(*b)).tagged(tag),
serde_hjson::Value::F64(n) => { serde_hjson::Value::F64(n) => {
Value::Primitive(Primitive::Float(OF64::from(*n))).tagged(tag) Value::Primitive(Primitive::Float(OF64::from(*n))).tagged(tag)