mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 20:47:44 +02:00
Add functions for each Value
case (#9736)
# Description This PR ensures functions exist to extract and create each and every `Value` case. It also renames `Value::boolean` to `Value::bool` to match `Value::test_bool`, `Value::as_bool`, and `Value::Bool`. Similarly, `Value::as_integer` was renamed to `Value::as_int` to be consistent with `Value::int`, `Value::test_int`, and `Value::Int`. These two renames can be undone if necessary. # User-Facing Changes No user facing changes, but two public functions were renamed which may affect downstream dependents.
This commit is contained in:
@ -246,7 +246,7 @@ fn heuristic_parse(
|
||||
Vec::new(),
|
||||
))
|
||||
} else {
|
||||
Ok(PipelineData::Value(Value::boolean(false, span), None))
|
||||
Ok(PipelineData::Value(Value::bool(false, span), None))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -291,7 +291,7 @@ fn heuristic_parse_file(
|
||||
Vec::new(),
|
||||
))
|
||||
} else {
|
||||
Ok(PipelineData::Value(Value::boolean(false, call.head), None))
|
||||
Ok(PipelineData::Value(Value::bool(false, call.head), None))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -337,10 +337,10 @@ fn parse_module(
|
||||
Vec::new(),
|
||||
))
|
||||
} else {
|
||||
Ok(PipelineData::Value(Value::boolean(false, new_span), None))
|
||||
Ok(PipelineData::Value(Value::bool(false, new_span), None))
|
||||
}
|
||||
} else {
|
||||
Ok(PipelineData::Value(Value::boolean(true, new_span), None))
|
||||
Ok(PipelineData::Value(Value::bool(true, new_span), None))
|
||||
}
|
||||
}
|
||||
|
||||
@ -370,10 +370,10 @@ fn parse_script(
|
||||
Vec::new(),
|
||||
))
|
||||
} else {
|
||||
Ok(PipelineData::Value(Value::boolean(false, span), None))
|
||||
Ok(PipelineData::Value(Value::bool(false, span), None))
|
||||
}
|
||||
} else {
|
||||
Ok(PipelineData::Value(Value::boolean(true, span), None))
|
||||
Ok(PipelineData::Value(Value::bool(true, span), None))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user