We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c06f004 commit 8d0d3e9Copy full SHA for 8d0d3e9
src/lib.rs
@@ -301,8 +301,8 @@ impl TextRange {
301
302
// BREAK: pass by value
303
#[inline(always)]
304
- /// The smallest convex set that contains both ranges
305
- pub fn convex_hull(&self, other: &TextRange) -> TextRange {
+ /// The smallest range that contains both ranges
+ pub fn extend_to(&self, other: &TextRange) -> TextRange {
306
let start = self.start().min(other.start());
307
let end = self.end().max(other.end());
308
TextRange::from_to(start, end)
@@ -443,10 +443,10 @@ mod tests {
443
}
444
445
#[test]
446
- fn check_convex_hull() {
447
- assert_eq!(r(1, 2).convex_hull(&r(2, 3)), r(1, 3));
448
- assert_eq!(r(1, 5).convex_hull(&r(2, 3)), r(1, 5));
449
- assert_eq!(r(1, 2).convex_hull(&r(4, 5)), r(1, 5));
+ fn check_extend_to() {
+ assert_eq!(r(1, 2).extend_to(&r(2, 3)), r(1, 3));
+ assert_eq!(r(1, 5).extend_to(&r(2, 3)), r(1, 5));
+ assert_eq!(r(1, 2).extend_to(&r(4, 5)), r(1, 5));
450
451
452
0 commit comments