rust/integral-geometry/src/lib.rs
changeset 15046 dc4a12a84c92
parent 14747 75ff5c643004
child 15203 decb2f1c682b
--- a/rust/integral-geometry/src/lib.rs	Tue May 21 23:04:50 2019 +0300
+++ b/rust/integral-geometry/src/lib.rs	Wed May 22 22:42:20 2019 +0300
@@ -1,7 +1,7 @@
 use fpnum::{distance, fp, FPNum, FPPoint};
 use std::{
     cmp::{max, min},
-    ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Range, RangeInclusive, Sub, SubAssign},
+    ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, RangeInclusive, Sub, SubAssign},
 };
 
 #[derive(PartialEq, Eq, Clone, Copy, Debug)]
@@ -416,7 +416,7 @@
 
     #[inline]
     pub fn contains(&self, point: Point) -> bool {
-        self.x_range().contains(point.x) && self.y_range().contains(point.y)
+        self.x_range().contains(&point.x) && self.y_range().contains(&point.y)
     }
 
     #[inline]
@@ -467,22 +467,6 @@
     }
 }
 
-trait RangeContains<T> {
-    fn contains(&self, value: T) -> bool;
-}
-
-impl<T: Ord> RangeContains<T> for Range<T> {
-    fn contains(&self, value: T) -> bool {
-        value >= self.start && value < self.end
-    }
-}
-
-impl<T: Ord> RangeContains<T> for RangeInclusive<T> {
-    fn contains(&self, value: T) -> bool {
-        value >= *self.start() && value <= *self.end()
-    }
-}
-
 trait RangeClamp<T> {
     fn clamp(&self, value: T) -> T;
 }