From 983de8974b956570c5616a3818b40db2f0aa23d4 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Fri, 5 Mar 2021 14:07:54 -0600 Subject: [PATCH] hopefully fixes the coercion error when comparing $nothing to $var (#3133) --- Cargo.lock | 3 ++- crates/nu-data/src/base.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index e0eec758e0..98a20ee117 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2949,7 +2949,7 @@ dependencies = [ [[package]] name = "minus" version = "3.2.0" -source = "git+https://github.com/rezural/minus?branch=add-finished-callback#b943ed5c9143924ca1f871e4911a82c2e784001a" +source = "git+https://github.com/arijit79/minus?branch=main#eadb315644dcc051a0a3a7d4739bd59dfb37f0bd" dependencies = [ "async-std", "crossterm 0.19.0", @@ -3322,6 +3322,7 @@ dependencies = [ "chrono-tz", "clap", "codespan-reporting", + "crossterm 0.19.0", "csv", "ctrlc", "derive-new", diff --git a/crates/nu-data/src/base.rs b/crates/nu-data/src/base.rs index 28a1a059d3..001895b7de 100644 --- a/crates/nu-data/src/base.rs +++ b/crates/nu-data/src/base.rs @@ -147,6 +147,8 @@ pub fn coerce_compare_primitive( (Date(left), Date(right)) => CompareValues::Date(*left, *right), (Date(left), Duration(right)) => CompareValues::DateDuration(*left, right.clone()), (Boolean(left), Boolean(right)) => CompareValues::Booleans(*left, *right), + (Boolean(left), Nothing) => CompareValues::Booleans(*left, false), + (Nothing, Boolean(right)) => CompareValues::Booleans(false, *right), (FilePath(left), String(right)) => { CompareValues::String(left.as_path().display().to_string(), right.clone()) }