Move empty range function into algorithm utils
This commit is contained in:
parent
1cc4ec4d25
commit
5a24bb8652
5 changed files with 10 additions and 8 deletions
7
src/algorithms/utils.rs
Normal file
7
src/algorithms/utils.rs
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue