Minify mapping
This commit is contained in:
parent
eff4f547ba
commit
e35d78fedb
1 changed files with 3 additions and 3 deletions
|
@ -165,9 +165,9 @@ fn into_value(value: Value, s: String) -> Option<Value> {
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
match value {
|
match value {
|
||||||
Value::String(_) => Some(Value::String(s)),
|
Value::String(_) => Some(Value::String(s)),
|
||||||
Value::Integer(_) => FromStr::from_str(&s[..]).ok().map(|i| Value::Integer(i)),
|
Value::Integer(_) => FromStr::from_str(&s[..]).ok().map(Value::Integer),
|
||||||
Value::Float(_) => FromStr::from_str(&s[..]).ok().map(|f| Value::Float(f)),
|
Value::Float(_) => FromStr::from_str(&s[..]).ok().map(Value::Float),
|
||||||
Value::Boolean(_) => {
|
Value::Boolean(_) => {
|
||||||
if s == "true" { Some(Value::Boolean(true)) }
|
if s == "true" { Some(Value::Boolean(true)) }
|
||||||
else if s == "false" { Some(Value::Boolean(false)) }
|
else if s == "false" { Some(Value::Boolean(false)) }
|
||||||
|
|
Loading…
Reference in a new issue