From 8e927a969543385c8168e535d736b297e888b9d6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 5 Mar 2021 19:37:26 +0000 Subject: [PATCH] utils: Fix Area (!) Signed-off-by: Ian Jackson --- src/spec.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/spec.rs b/src/spec.rs index 3064a2eb..06af4565 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -363,15 +363,15 @@ pub mod implementation { impl AreaC { pub fn contains(&self, p: PosC) -> bool where T: Ord { (0..2).all(|i| { - p.0[i] < self.0[0].0[i] || - p.0[i] > self.0[1].0[i] + p.0[i] >= self.0[0].0[i] && + p.0[i] <= self.0[1].0[i] }) } pub fn overlaps(&self, other: &AreaC) -> bool where T: Ord { - (0..2).all(|i| !( - other.0[1].0[i] < self.0[0].0[i] || - other.0[0].0[i] > self.0[1].0[i] + ! (0..2).any(|i| !( + other.0[1].0[i] < self .0[0].0[i] || + self .0[1].0[i] < other.0[0].0[i] )) } } -- 2.30.2