Skip to content

Commit

Permalink
feat: add Range::is_empty() (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin authored Mar 12, 2024
1 parent d272713 commit 3549dc5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ impl<V> Range<V> {
segments: SmallVec::one((Included(v1.into()), Excluded(v2.into()))),
}
}

/// Whether the set is empty, i.e. it has not ranges
pub fn is_empty(&self) -> bool {
self.segments.is_empty()
}
}

impl<V: Clone> Range<V> {
Expand Down

0 comments on commit 3549dc5

Please sign in to comment.