mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 13:26:01 +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:
@ -12,7 +12,7 @@ pub fn eval_constant(
|
||||
expr: &Expression,
|
||||
) -> Result<Value, ParseError> {
|
||||
match &expr.expr {
|
||||
Expr::Bool(b) => Ok(Value::boolean(*b, expr.span)),
|
||||
Expr::Bool(b) => Ok(Value::bool(*b, expr.span)),
|
||||
Expr::Int(i) => Ok(Value::int(*i, expr.span)),
|
||||
Expr::Float(f) => Ok(Value::float(*f, expr.span)),
|
||||
Expr::Binary(b) => Ok(Value::Binary {
|
||||
|
Reference in New Issue
Block a user