Return Option<Value> from fun on replace_with to all user to return None (remove the value and not replace with Null)

This commit is contained in:
Guy Korland
2019-08-26 15:41:43 +03:00
committed by freestrings
parent e0db04aed9
commit 17a8608392
6 changed files with 24 additions and 16 deletions

View File

@ -224,7 +224,7 @@ fn readme_selector_mut() {
0
};
json!(age)
Some(json!(age))
})
.unwrap()
.take()
@ -522,7 +522,7 @@ fn readme_replace_with() {
0
};
json!(age)
Some(json!(age))
})
.unwrap();

View File

@ -23,7 +23,7 @@ fn selector_mut() {
if let Value::Number(n) = v {
nums.push(n.as_f64().unwrap());
}
Value::String("a".to_string())
Some(Value::String("a".to_string()))
})
.unwrap()
.take()