fix empty polygon iteration
authoralfadur
Fri, 05 Jul 2019 21:48:01 +0300
changeset 15236 13041ae61ac5
parent 15235 58a0f2a6527b
child 15237 387345a14b3f
fix empty polygon iteration
rust/integral-geometry/src/lib.rs
--- a/rust/integral-geometry/src/lib.rs	Fri Jul 05 21:16:33 2019 +0300
+++ b/rust/integral-geometry/src/lib.rs	Fri Jul 05 21:48:01 2019 +0300
@@ -500,7 +500,7 @@
     }
 
     pub fn edges_count(&self) -> usize {
-        self.vertices.len() - 1
+        self.vertices.len().saturating_sub(1)
     }
 
     pub fn get_edge(&self, index: usize) -> Line {