From da92e5c2837b27433286cf0dd9d887fd44dda254 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Sat, 27 Jan 2024 16:49:53 +0100 Subject: Fix clippy and enable clippy on CI --- src/data/arena.rs | 2 +- src/data/pubsub.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/data') diff --git a/src/data/arena.rs b/src/data/arena.rs index 3332539..57653da 100644 --- a/src/data/arena.rs +++ b/src/data/arena.rs @@ -269,7 +269,7 @@ impl Arena { self.free_list_head = next_free; self.len += 1; Some(Index { - index: i as u32, + index: i, generation: self.generation, }) } diff --git a/src/data/pubsub.rs b/src/data/pubsub.rs index 8c5f41c..619521e 100644 --- a/src/data/pubsub.rs +++ b/src/data/pubsub.rs @@ -106,8 +106,7 @@ impl PubSub { /// Read the i-th message not yet read by the given subsciber. pub fn read_ith(&self, sub: &Subscription, 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. -- cgit