Union the given overlapping range into this range. If the two ranges aren't contiguous, then this returns `None`.
(&self, other: &Self)
| 351 | /// |
| 352 | /// If the two ranges aren't contiguous, then this returns `None`. |
| 353 | fn union(&self, other: &Self) -> Option<Self> { |
| 354 | if !self.is_contiguous(other) { |
| 355 | return None; |
| 356 | } |
| 357 | let lower = cmp::min(self.lower(), other.lower()); |
| 358 | let upper = cmp::max(self.upper(), other.upper()); |
| 359 | Some(Self::create(lower, upper)) |
| 360 | } |
| 361 | |
| 362 | /// Intersect this range with the given range and return the result. |
| 363 | /// |
nothing calls this directly
no test coverage detected