Skip to content

Commit

Permalink
Use ptr::addr_eq for inbox channel comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasdezeeuw committed Mar 31, 2024
1 parent 1f97adf commit 51208cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inbox/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ impl<T> Sender<T> {

/// Returns `true` if senders send into the same channel.
pub fn same_channel(&self, other: &Sender<T>) -> bool {
self.channel == other.channel
ptr::addr_eq(self.channel.as_ptr(), other.channel.as_ptr())
}

/// Returns `true` if this sender sends to the `receiver`.
pub fn sends_to(&self, receiver: &Receiver<T>) -> bool {
self.channel == receiver.channel
ptr::addr_eq(self.channel.as_ptr(), receiver.channel.as_ptr())
}

/// Returns the id of this sender.
Expand Down

0 comments on commit 51208cb

Please sign in to comment.