Skip to content

Commit

Permalink
feat: add PartialEq and Eq for channel Errors
Browse files Browse the repository at this point in the history
Closes #792
  • Loading branch information
dignifiedquire committed May 22, 2020
1 parent 2521408 commit 06eea42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sync/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ impl<T> Drop for Channel<T> {
/// An error returned from the `try_send` method.
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[derive(PartialEq, Eq)]
pub enum TrySendError<T> {
/// The channel is full but not disconnected.
Full(T),
Expand Down Expand Up @@ -1023,7 +1024,7 @@ impl<T> Display for TrySendError<T> {
/// An error returned from the `try_recv` method.
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
pub enum TryRecvError {
/// The channel is empty but not disconnected.
Empty,
Expand All @@ -1046,7 +1047,7 @@ impl Display for TryRecvError {
/// An error returned from the `recv` method.
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
pub struct RecvError;

impl Error for RecvError {}
Expand Down

0 comments on commit 06eea42

Please sign in to comment.