MCPcopy Create free account
hub / github.com/davidblewett/rure-python / union

Method union

regex/regex-syntax/src/hir/interval.rs:353–360  ·  view source on GitHub ↗

Union the given overlapping range into this range. If the two ranges aren't contiguous, then this returns `None`.

(&self, other: &Self)

Source from the content-addressed store, hash-verified

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 ///

Callers

nothing calls this directly

Implementers 1

mod.rsregex/regex-syntax/src/hir/mod.rs

Calls 3

is_contiguousMethod · 0.80
lowerMethod · 0.80
upperMethod · 0.80

Tested by

no test coverage detected