rust/integral-geometry/src/lib.rs
changeset 15286 16bd389fc735
parent 15215 13041ae61ac5
child 15384 1c6d5656157c
--- a/rust/integral-geometry/src/lib.rs	Sat Aug 03 00:54:29 2019 +0300
+++ b/rust/integral-geometry/src/lib.rs	Sat Aug 03 01:13:45 2019 +0300
@@ -171,6 +171,14 @@
     pub fn contains(&self, other: Self) -> bool {
         self.width >= other.width && self.height >= other.height
     }
+
+    #[inline]
+    pub fn join(&self, other: Self) -> Self {
+        Self {
+            width: max(self.width, other.width),
+            height: max(self.height, other.height)
+        }
+    }
 }
 
 #[derive(PartialEq, Eq, Clone, Copy, Debug)]