From 0683259748f1dc720bdd7a8310671ddbaa62dfd5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 25 Mar 2021 12:43:16 +0000 Subject: [PATCH] geometry: Rename Region::Rectangle to Rect Signed-off-by: Ian Jackson --- base/geometry.rs | 8 ++++---- src/shapelib.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/base/geometry.rs b/base/geometry.rs index b0b9318f..c8fb8a13 100644 --- a/base/geometry.rs +++ b/base/geometry.rs @@ -280,7 +280,7 @@ fn empty_area() { #[derive(Clone,Debug,Serialize,Deserialize)] pub enum RegionC { - Rectangle(RectC), + Rect(RectC), } pub type Region = RegionC; @@ -288,19 +288,19 @@ impl RegionC { pub fn contains(&self, pos: PosC) -> bool where T: PartialOrd { use RegionC::*; match &self { - Rectangle(a) => a.contains(pos), + Rect(a) => a.contains(pos), } } pub fn overlaps(&self, other: &RegionC) -> bool where T: PartialOrd { use RegionC::*; match (self, other) { - (Rectangle(a), Rectangle(b)) => a.overlaps(b) + (Rect(a), Rect(b)) => a.overlaps(b) } } pub fn empty() -> Self where T: Copy + num_traits::Zero + num_traits::One { - RegionC::Rectangle(RectC::empty()) + RegionC::Rect(RectC::empty()) } } diff --git a/src/shapelib.rs b/src/shapelib.rs index 34242520..ae397939 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -799,7 +799,7 @@ impl Rectangle { #[throws(CoordinateOverflow)] pub fn region(&self, centre: Pos) -> Region { - Region::Rectangle(self.rect(centre)?) + Region::Rect(self.rect(centre)?) } } -- 2.30.2