Skip to content

Commit 7b1eac7

Browse files
committed
change Weekdays::len return type to u8
1 parent 03d6850 commit 7b1eac7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/weekdays.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ impl Weekdays {
102102
/// assert_eq!((Weekdays::MON | Weekdays::WED | Weekdays::FRI).len(), 3);
103103
/// assert_eq!(Weekdays::ALL.len(), 7);
104104
/// ```
105-
pub const fn len(self) -> usize {
106-
self.0.count_ones() as usize
105+
pub const fn len(self) -> u8 {
106+
self.0.count_ones() as u8
107107
}
108108
/// Returns `true` if the set is empty.
109109
///
@@ -291,7 +291,7 @@ impl DoubleEndedIterator for WeekdaysIter {
291291
}
292292
impl ExactSizeIterator for WeekdaysIter {
293293
fn len(&self) -> usize {
294-
self.0.len()
294+
self.0.len().into()
295295
}
296296
}
297297
impl FusedIterator for WeekdaysIter {}

0 commit comments

Comments
 (0)