Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 06eea42

Browse files
feat: add PartialEq and Eq for channel Errors
Closes #792
1 parent 2521408 commit 06eea42

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/sync/channel.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ impl<T> Drop for Channel<T> {
992992
/// An error returned from the `try_send` method.
993993
#[cfg(feature = "unstable")]
994994
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
995+
#[derive(PartialEq, Eq)]
995996
pub enum TrySendError<T> {
996997
/// The channel is full but not disconnected.
997998
Full(T),
@@ -1023,7 +1024,7 @@ impl<T> Display for TrySendError<T> {
10231024
/// An error returned from the `try_recv` method.
10241025
#[cfg(feature = "unstable")]
10251026
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
1026-
#[derive(Debug)]
1027+
#[derive(Debug,PartialEq,Eq)]
10271028
pub enum TryRecvError {
10281029
/// The channel is empty but not disconnected.
10291030
Empty,
@@ -1046,7 +1047,7 @@ impl Display for TryRecvError {
10461047
/// An error returned from the `recv` method.
10471048
#[cfg(feature = "unstable")]
10481049
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
1049-
#[derive(Debug)]
1050+
#[derive(Debug,PartialEq,Eq)]
10501051
pub struct RecvError;
10511052

10521053
impl Error for RecvError {}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /