summaryrefslogtreecommitdiff
path: root/src/channel/history.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/channel/history.rs')
-rw-r--r--src/channel/history.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/channel/history.rs b/src/channel/history.rs
index 4b9fcc7..dda7bb9 100644
--- a/src/channel/history.rs
+++ b/src/channel/history.rs
@@ -1,3 +1,5 @@
+use itertools::Itertools as _;
+
use super::{
event::{Created, Deleted, Event},
Channel, Id,
@@ -41,7 +43,9 @@ impl History {
// Event factories
impl History {
pub fn events(&self) -> impl Iterator<Item = Event> {
- [self.created()].into_iter().chain(self.deleted())
+ [self.created()]
+ .into_iter()
+ .merge_by(self.deleted(), Sequence::merge)
}
fn created(&self) -> Event {