Move empty range function into algorithm utils

This commit is contained in:
Armin Ronacher 2021-02-20 20:58:01 +01:00
parent 1cc4ec4d25
commit 5a24bb8652
5 changed files with 10 additions and 8 deletions

7
src/algorithms/utils.rs Normal file
View file

@ -0,0 +1,7 @@
use std::ops::Range;
/// Utility function to check if a range is empty that works on older rust versions
#[inline(always)]
pub(crate) fn is_empty_range<T: PartialOrd>(range: &Range<T>) -> bool {
!(range.start < range.end)
}