--- a/rust/hedgewars-server/src/core/events.rs Tue Sep 07 01:45:16 2021 +0300
+++ b/rust/hedgewars-server/src/core/events.rs Thu Sep 09 21:06:45 2021 +0300
@@ -29,12 +29,7 @@
impl<Data, const MAX_TIMEOUT: usize> TimedEvents<Data, MAX_TIMEOUT> {
pub fn new() -> Self {
Self {
- events: iter::repeat_with(|| Slab::new())
- .take(MAX_TIMEOUT)
- .collect::<Vec<_>>()
- .try_into()
- .ok()
- .unwrap(),
+ events: [0; MAX_TIMEOUT].map(|_| Slab::new()),
current_time: Instant::now(),
current_tick_index: 0,
next_event_id: 0,