diff --git a/crates/federate/src/send.rs b/crates/federate/src/send.rs index 46a612ef4..9658acf66 100644 --- a/crates/federate/src/send.rs +++ b/crates/federate/src/send.rs @@ -14,18 +14,19 @@ use std::ops::Deref; use tokio::{sync::mpsc::UnboundedSender, time::sleep}; use tokio_util::sync::CancellationToken; -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, Eq)] pub(crate) struct SendSuccessInfo { pub activity_id: ActivityId, pub published: Option>, pub was_skipped: bool, } -// order backwards by activity_id for the binary heap in the worker +/// order backwards by activity_id for the binary heap in the worker impl PartialEq for SendSuccessInfo { fn eq(&self, other: &Self) -> bool { self.activity_id == other.activity_id } } +/// order backwards because the binary heap is a max heap, and we need the smallest element to be on top impl PartialOrd for SendSuccessInfo { fn partial_cmp(&self, other: &Self) -> Option { other.activity_id.partial_cmp(&self.activity_id)