Make clippy happy

This commit is contained in:
Armin Ronacher 2021-02-21 15:52:05 +01:00
parent 77c7654589
commit c32556cfee

View file

@ -5,9 +5,11 @@ use std::ops::{Index, Range};
/// Utility function to check if a range is empty that works on older rust versions
#[inline(always)]
pub fn is_empty_range<T: PartialOrd>(range: &Range<T>) -> bool {
#[allow(clippy::neg_cmp_op_on_partial_ord)]
pub fn is_empty_range<T: PartialOrd<T>>(range: &Range<T>) -> bool {
!(range.start < range.end)
}
pub struct Indexable<'a, Idx: ?Sized> {
lookup: &'a Idx,
index: usize,