mirror of
https://github.com/nushell/nushell
synced 2025-01-16 07:04:09 +00:00
Fix Range::contains
This commit is contained in:
parent
4235cf1191
commit
5f9ad0947d
1 changed files with 1 additions and 1 deletions
|
@ -115,7 +115,7 @@ impl Range {
|
||||||
pub fn contains(&self, item: &Value) -> bool {
|
pub fn contains(&self, item: &Value) -> bool {
|
||||||
match (item.partial_cmp(&self.from), item.partial_cmp(&self.to)) {
|
match (item.partial_cmp(&self.from), item.partial_cmp(&self.to)) {
|
||||||
(Some(Ordering::Greater | Ordering::Equal), Some(Ordering::Less)) => self.moves_up(),
|
(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(),
|
(Some(_), Some(Ordering::Equal)) => self.is_end_inclusive(),
|
||||||
(_, _) => false,
|
(_, _) => false,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue