diff --git a/crates/nu-engine/src/eval.rs b/crates/nu-engine/src/eval.rs index 539bcbe65..530dc2646 100644 --- a/crates/nu-engine/src/eval.rs +++ b/crates/nu-engine/src/eval.rs @@ -408,7 +408,7 @@ pub fn eval_expression( match op { Operator::And => { - if !lhs.is_true() { + if lhs.is_false() { Ok(Value::Bool { val: false, span: expr.span, diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs index 145a88a0d..b32344889 100644 --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -1176,6 +1176,10 @@ impl Value { matches!(self, Value::Bool { val: true, .. }) } + pub fn is_false(&self) -> bool { + matches!(self, Value::Bool { val: false, .. }) + } + pub fn columns(&self) -> Vec { match self { Value::Record { cols, .. } => cols.clone(),