Skip to content

Commit 6c5a206

Browse files
authored
Merge pull request #12 from rklaehn/range-set-ref-default
Add default to &RangeSetRef as well
2 parents be303d5 + caea1af commit 6c5a206

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/range_set.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ impl<'a, T> Iterator for Iter<'a, T> {
250250
#[repr(transparent)]
251251
pub struct RangeSetRef<T>([T]);
252252

253+
impl<T> Default for &RangeSetRef<T> {
254+
fn default() -> Self {
255+
RangeSetRef::new_unchecked_impl(&[])
256+
}
257+
}
258+
253259
impl<T> RangeSetRef<T> {
254260
/// Create a new range set reference for an empty range set
255261
pub const fn empty() -> &'static Self {

0 commit comments

Comments
 (0)