Fix clippy and enable clippy on CI

This commit is contained in:
Sébastien Crozet
2024-01-27 16:49:53 +01:00
committed by Sébastien Crozet
parent aef873f20e
commit da92e5c283
81 changed files with 420 additions and 468 deletions

View File

@@ -269,7 +269,7 @@ impl<T> Arena<T> {
self.free_list_head = next_free;
self.len += 1;
Some(Index {
index: i as u32,
index: i,
generation: self.generation,
})
}

View File

@@ -106,8 +106,7 @@ impl<T> PubSub<T> {
/// Read the i-th message not yet read by the given subsciber.
pub fn read_ith(&self, sub: &Subscription<T>, i: usize) -> Option<&T> {
let cursor = &self.cursors[sub.id as usize];
self.messages
.get(cursor.next(self.deleted_messages) as usize + i)
self.messages.get(cursor.next(self.deleted_messages) + i)
}
/// Get the messages not yet read by the given subscriber.