-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
C-DocsAn addition or correction to our documentationAn addition or correction to our documentationS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled
Description
I am not certain if this is a docs issue, but I found this by looking at the source, not by encountering some bug. That is why for now I focused on how the API appears while there are more issues.
The methods Events::oldest_event_count
and Events::oldest_id
seem to do the same thing when looked at the docs or the source.
Also the API itself is confusing. Instead of returning usize
it should return an Option<EventId<E>>
because no oldest event might be available currently if the sequences events_b
and events_a
are empty.
As a side note, the implementation of oldest_event_count
looks like that:
/// Returns the index of the oldest event stored in the event buffer.
pub fn oldest_event_count(&self) -> usize {
self.events_a
.start_event_count
.min(self.events_b.start_event_count)
}
When it should be clear that self.events_b
as the more recent sequence cannot contain the oldest count.
oldest_event_count
was added by [Merged by Bors] - Warning message for missing events #5730oldest_id
was added by [Merged by Bors] - Rework manual event iterator so we can actually name the type #5735
Metadata
Metadata
Assignees
Labels
C-DocsAn addition or correction to our documentationAn addition or correction to our documentationS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled