Skip to content

Commit 0aa11a3

Browse files
authored
clippy (#27)
1 parent 3ee89aa commit 0aa11a3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/timer.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,13 @@ impl<T> Timer<T> {
152152
let num_slots = num_slots.next_power_of_two();
153153
let capacity = capacity.next_power_of_two();
154154
let mask = (num_slots as u64) - 1;
155-
let wheel = iter::repeat(WheelEntry {
156-
next_tick: TICK_MAX,
157-
head: EMPTY,
158-
})
159-
.take(num_slots)
155+
let wheel = iter::repeat_n(
156+
WheelEntry {
157+
next_tick: TICK_MAX,
158+
head: EMPTY,
159+
},
160+
num_slots,
161+
)
160162
.collect();
161163

162164
Timer {

0 commit comments

Comments
 (0)