File tree 1 file changed +2
-5
lines changed
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -407,8 +407,8 @@ pub trait DoubleEndedSearcher<H: Haystack>: ReverseSearcher<H> {}
407
407
// equivalent to SearchPtrs in "Pattern API 1.5"
408
408
// and PatternHaystack in "Pattern API 2.0"
409
409
pub trait Haystack: Sized {
410
- type StartCursor: Copy;
411
- type EndCursor: Copy;
410
+ type StartCursor: Copy + PartialOrd<Self::EndCursor> ;
411
+ type EndCursor: Copy + PartialOrd<Self::StartCursor> ;
412
412
413
413
// The following 5 methods are same as those in "Pattern API 1.5"
414
414
// except the cursor type is split into two.
@@ -418,9 +418,6 @@ pub trait Haystack: Sized {
418
418
unsafe fn end_cursor_to_offset(hs: &Self, cur: Self::EndCursor) -> usize;
419
419
unsafe fn range_to_self(hs: Self, start: Self::StartCursor, end: Self::EndCursor) -> Self;
420
420
421
- // Since a StartCursor and EndCursor may not be comparable, we also need this method
422
- fn is_range_empty(start: Self::StartCursor, end: Self::EndCursor) -> bool;
423
-
424
421
// And then we want to swap between the two cursor types
425
422
unsafe fn start_to_end_cursor(hs: &Self, cur: Self::StartCursor) -> Self::EndCursor;
426
423
unsafe fn end_to_start_cursor(hs: &Self, cur: Self::EndCursor) -> Self::StartCursor;
You can’t perform that action at this time.
0 commit comments