Skip to content

Commit 8d0d3e9

Browse files
committed
Rename convex_hull to extend_to
1 parent c06f004 commit 8d0d3e9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ impl TextRange {
301301

302302
// BREAK: pass by value
303303
#[inline(always)]
304-
/// The smallest convex set that contains both ranges
305-
pub fn convex_hull(&self, other: &TextRange) -> TextRange {
304+
/// The smallest range that contains both ranges
305+
pub fn extend_to(&self, other: &TextRange) -> TextRange {
306306
let start = self.start().min(other.start());
307307
let end = self.end().max(other.end());
308308
TextRange::from_to(start, end)
@@ -443,10 +443,10 @@ mod tests {
443443
}
444444

445445
#[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));
446+
fn check_extend_to() {
447+
assert_eq!(r(1, 2).extend_to(&r(2, 3)), r(1, 3));
448+
assert_eq!(r(1, 5).extend_to(&r(2, 3)), r(1, 5));
449+
assert_eq!(r(1, 2).extend_to(&r(4, 5)), r(1, 5));
450450
}
451451

452452
#[test]

0 commit comments

Comments
 (0)