aboutsummaryrefslogtreecommitdiff
path: root/src/data/pubsub.rs
diff options
context:
space:
mode:
authorThierry Berger <contact@thierryberger.com>2024-05-29 11:15:42 +0200
committerGitHub <noreply@github.com>2024-05-29 11:15:42 +0200
commitcfcbe58920d7fa2177e9a1887b92cf20d5dab337 (patch)
tree3e73a256258a5a8ae5a9a6f8cb06f003b235e66c /src/data/pubsub.rs
parent798406e00de86b78d86ae8903b2c598938fa1089 (diff)
parenta1b36b06298e99e442154c593551344236c48380 (diff)
downloadrapier-cfcbe58920d7fa2177e9a1887b92cf20d5dab337.tar.gz
rapier-cfcbe58920d7fa2177e9a1887b92cf20d5dab337.tar.bz2
rapier-cfcbe58920d7fa2177e9a1887b92cf20d5dab337.zip
Merge pull request #639 from dimforge/fix-todo-range
Fix trivial todo; removing a private type.
Diffstat (limited to 'src/data/pubsub.rs')
-rw-r--r--src/data/pubsub.rs22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/data/pubsub.rs b/src/data/pubsub.rs
index d595e03..92789f2 100644
--- a/src/data/pubsub.rs
+++ b/src/data/pubsub.rs
@@ -114,11 +114,7 @@ impl<T> PubSub<T> {
let cursor = &self.cursors[sub.id as usize];
let next = cursor.next(self.deleted_messages);
- // TODO: use self.queue.range(next..) once it is stabilised.
- MessageRange {
- queue: &self.messages,
- next,
- }
+ self.messages.range(next..)
}
/// Makes the given subscribe acknowledge all the messages in the queue.
@@ -159,19 +155,3 @@ impl<T> PubSub<T> {
}
}
}
-
-struct MessageRange<'a, T> {
- queue: &'a VecDeque<T>,
- next: usize,
-}
-
-impl<'a, T> Iterator for MessageRange<'a, T> {
- type Item = &'a T;
-
- #[inline(always)]
- fn next(&mut self) -> Option<&'a T> {
- let result = self.queue.get(self.next);
- self.next += 1;
- result
- }
-}