about summary refs log tree commit diff
path: root/src/libstd/sync/mpsc
diff options
context:
space:
mode:
authorIgor Aleksanov <popzxc@yandex.ru>2020-01-07 10:35:16 +0300
committerIgor Aleksanov <popzxc@yandex.ru>2020-01-08 07:10:28 +0300
commitf720469fd0c4dff6d92e2f778ea2f252f76dcc2e (patch)
treeeed0768e1946a78b266025d661016f190795d871 /src/libstd/sync/mpsc
parentaa0769b92e60f5298f0b6326b8654c9b04351b98 (diff)
downloadrust-f720469fd0c4dff6d92e2f778ea2f252f76dcc2e.tar.gz
rust-f720469fd0c4dff6d92e2f778ea2f252f76dcc2e.zip
Use matches macro in libcore and libstd
Diffstat (limited to 'src/libstd/sync/mpsc')
-rw-r--r--src/libstd/sync/mpsc/oneshot.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/libstd/sync/mpsc/oneshot.rs b/src/libstd/sync/mpsc/oneshot.rs
index bbe77e7d0fb..5b41525e06a 100644
--- a/src/libstd/sync/mpsc/oneshot.rs
+++ b/src/libstd/sync/mpsc/oneshot.rs
@@ -118,12 +118,7 @@ impl<T> Packet<T> {
     // Just tests whether this channel has been sent on or not, this is only
     // safe to use from the sender.
     pub fn sent(&self) -> bool {
-        unsafe {
-            match *self.upgrade.get() {
-                NothingSent => false,
-                _ => true,
-            }
-        }
+        unsafe { !matches!(*self.upgrade.get(), NothingSent) }
     }
 
     pub fn recv(&self, deadline: Option<Instant>) -> Result<T, Failure<T>> {