Files
hexapoda/src/utilities/is_overlapping.rs
T
2026-05-01 00:44:24 -05:00

12 lines
272 B
Rust

use std::ops::RangeInclusive;
pub trait IsOverlapping {
fn is_overlapping(&self, other: &Self) -> bool;
}
impl IsOverlapping for RangeInclusive<usize> {
fn is_overlapping(&self, other: &Self) -> bool {
self.contains(other.start()) || self.contains(other.end())
}
}