diff -r 6382a14c9e83 -r 16bd389fc735 rust/integral-geometry/src/lib.rs --- 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)]