From f720469fd0c4dff6d92e2f778ea2f252f76dcc2e Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Tue, 7 Jan 2020 10:35:16 +0300 Subject: Use matches macro in libcore and libstd --- src/libstd/sync/mpsc/oneshot.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/libstd/sync/mpsc') 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 Packet { // 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) -> Result> { -- cgit 1.4.1-3-g733a5