add the is_valid trait default method
This commit is contained in:
@@ -1418,6 +1418,13 @@ pub trait InclusiveRange<I> {
|
|||||||
point >= self.start() && point <= self.end()
|
point >= self.start() && point <= self.end()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn is_valid(&self) -> bool
|
||||||
|
where
|
||||||
|
I: Ord,
|
||||||
|
{
|
||||||
|
self.start() <= self.end()
|
||||||
|
}
|
||||||
|
|
||||||
///requires that self comes before other and they don't overlap
|
///requires that self comes before other and they don't overlap
|
||||||
fn touches_ordered(&self, other: &Self) -> bool
|
fn touches_ordered(&self, other: &Self) -> bool
|
||||||
where
|
where
|
||||||
|
|||||||
Reference in New Issue
Block a user