mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 00:44:57 +02:00
Remove interpretation of Primitive::Nothing
as the number 0. (#1836)
This commit is contained in:
@ -153,13 +153,7 @@ fn coerce_compare_primitive(
|
||||
(Bytes(left), Decimal(right)) => {
|
||||
CompareValues::Decimals(BigDecimal::from(*left), right.clone())
|
||||
}
|
||||
(Bytes(left), Nothing) => CompareValues::Ints(BigInt::from(*left), BigInt::from(0)),
|
||||
(Nothing, Nothing) => CompareValues::Ints(BigInt::from(0), BigInt::from(0)),
|
||||
(Nothing, Bytes(right)) => CompareValues::Ints(BigInt::from(0), BigInt::from(*right)),
|
||||
(Int(left), Nothing) => CompareValues::Ints(left.clone(), BigInt::from(0)),
|
||||
(Nothing, Int(right)) => CompareValues::Ints(BigInt::from(0), right.clone()),
|
||||
(Decimal(left), Nothing) => CompareValues::Decimals(left.clone(), BigDecimal::from(0.0)),
|
||||
(Nothing, Decimal(right)) => CompareValues::Decimals(BigDecimal::from(0.0), right.clone()),
|
||||
(Nothing, Nothing) => CompareValues::Booleans(true, true),
|
||||
(String(left), String(right)) => CompareValues::String(left.clone(), right.clone()),
|
||||
(Line(left), String(right)) => CompareValues::String(left.clone(), right.clone()),
|
||||
(String(left), Line(right)) => CompareValues::String(left.clone(), right.clone()),
|
||||
|
@ -26,10 +26,6 @@ impl ExtractType for bool {
|
||||
value: UntaggedValue::Primitive(Primitive::Boolean(b)),
|
||||
..
|
||||
} => Ok(*b),
|
||||
Value {
|
||||
value: UntaggedValue::Primitive(Primitive::Nothing),
|
||||
..
|
||||
} => Ok(false),
|
||||
other => Err(ShellError::type_error("Boolean", other.spanned_type_name())),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user