mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 19:57:53 +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:
@ -145,7 +145,7 @@ fn from_ods(
|
||||
DataType::String(s) => Value::string(s, head),
|
||||
DataType::Float(f) => Value::float(*f, head),
|
||||
DataType::Int(i) => Value::int(*i, head),
|
||||
DataType::Bool(b) => Value::boolean(*b, head),
|
||||
DataType::Bool(b) => Value::bool(*b, head),
|
||||
_ => Value::nothing(head),
|
||||
};
|
||||
|
||||
|
@ -144,7 +144,7 @@ fn from_xlsx(
|
||||
DataType::String(s) => Value::string(s, head),
|
||||
DataType::Float(f) => Value::float(*f, head),
|
||||
DataType::Int(i) => Value::int(*i, head),
|
||||
DataType::Bool(b) => Value::boolean(*b, head),
|
||||
DataType::Bool(b) => Value::bool(*b, head),
|
||||
_ => Value::nothing(head),
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user