Skip to content

Commit

Permalink
Use is_ok() instead of empty Ok(_)
Browse files Browse the repository at this point in the history
Signed-off-by: wcampbell <wcampbell1995@gmail.com>
  • Loading branch information
wcampbell0x2a committed Oct 13, 2020
1 parent a93f58f commit 964a5ac
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions library/std/src/net/udp/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 964a5ac

Please sign in to comment.