From 5f9ad0947dc803fe51b1de1465bc7606533766ea Mon Sep 17 00:00:00 2001 From: Arthur Targaryen Date: Sat, 9 Oct 2021 17:58:39 +0200 Subject: [PATCH] Fix `Range::contains` --- crates/nu-protocol/src/value/range.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-protocol/src/value/range.rs b/crates/nu-protocol/src/value/range.rs index f414dd0dc..56fc052fd 100644 --- a/crates/nu-protocol/src/value/range.rs +++ b/crates/nu-protocol/src/value/range.rs @@ -115,7 +115,7 @@ impl Range { pub fn contains(&self, item: &Value) -> bool { match (item.partial_cmp(&self.from), item.partial_cmp(&self.to)) { (Some(Ordering::Greater | Ordering::Equal), Some(Ordering::Less)) => self.moves_up(), - (Some(Ordering::Less | Ordering::Equal), Some(Ordering::Greater)) => self.moves_up(), + (Some(Ordering::Less | Ordering::Equal), Some(Ordering::Greater)) => !self.moves_up(), (Some(_), Some(Ordering::Equal)) => self.is_end_inclusive(), (_, _) => false, }