Gouzi Mohaled
Ajout du dossier lib
84d2a97
raw
history blame contribute delete
542 Bytes
use std::ops::Bound;
use std::ops::Bound::{Excluded, Included};
pub fn check_boundaries<T>(start: &Bound<T>, end: &Bound<T>) -> bool
where
T: PartialOrd,
{
match (&start, &end) {
(Excluded(s), Excluded(e)) if s >= e => {
// range start and end are equal and excluded in BTreeMap
return false;
}
(Included(s) | Excluded(s), Included(e) | Excluded(e)) if s > e => {
//range start is greater than range end
return false;
}
_ => {}
}
true
}