Skip to content

Commit 964a5ac

Browse files
committed
Use is_ok() instead of empty Ok(_)
Signed-off-by: wcampbell <[email protected]>
1 parent a93f58f commit 964a5ac

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

library/std/src/net/udp/tests.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,13 @@ fn udp_clone_two_write() {
152152
let (done, rx) = channel();
153153
let tx2 = tx.clone();
154154
let _t = thread::spawn(move || {
155-
match sock3.send_to(&[1], &addr2) {
156-
Ok(..) => {
157-
let _ = tx2.send(());
158-
}
159-
Err(..) => {}
155+
if sock3.send_to(&[1], &addr2).is_ok() {
156+
let _ = tx2.send(());
160157
}
161158
done.send(()).unwrap();
162159
});
163-
match sock1.send_to(&[2], &addr2) {
164-
Ok(..) => {
165-
let _ = tx.send(());
166-
}
167-
Err(..) => {}
160+
if sock1.send_to(&[2], &addr2).is_ok() {
161+
let _ = tx.send(());
168162
}
169163
drop(tx);
170164

0 commit comments

Comments
 (0)