about summary refs log tree commit diff
diff options
context:
space:
mode:
authorwcampbell <wcampbell1995@gmail.com>2020-10-13 17:01:50 -0400
committerwcampbell <wcampbell1995@gmail.com>2020-10-13 17:01:50 -0400
commit964a5ac962d32c280d036df42b2e747809939cc4 (patch)
tree29820c24a035c341b9053a06941bec11c87f5ffd
parenta93f58f5e6c9e4e1fbc076d966a9e1e853ea06fd (diff)
downloadrust-964a5ac962d32c280d036df42b2e747809939cc4.tar.gz
rust-964a5ac962d32c280d036df42b2e747809939cc4.zip
Use is_ok() instead of empty Ok(_)
Signed-off-by: wcampbell <wcampbell1995@gmail.com>
-rw-r--r--library/std/src/net/udp/tests.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/library/std/src/net/udp/tests.rs b/library/std/src/net/udp/tests.rs
index 658369f79aa..fbed3d32d45 100644
--- a/library/std/src/net/udp/tests.rs
+++ b/library/std/src/net/udp/tests.rs
@@ -152,19 +152,13 @@ fn udp_clone_two_write() {
         let (done, rx) = channel();
         let tx2 = tx.clone();
         let _t = thread::spawn(move || {
-            match sock3.send_to(&[1], &addr2) {
-                Ok(..) => {
-                    let _ = tx2.send(());
-                }
-                Err(..) => {}
+            if sock3.send_to(&[1], &addr2).is_ok() {
+                let _ = tx2.send(());
             }
             done.send(()).unwrap();
         });
-        match sock1.send_to(&[2], &addr2) {
-            Ok(..) => {
-                let _ = tx.send(());
-            }
-            Err(..) => {}
+        if sock1.send_to(&[2], &addr2).is_ok() {
+            let _ = tx.send(());
         }
         drop(tx);