We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a93f58f commit 964a5acCopy full SHA for 964a5ac
library/std/src/net/udp/tests.rs
@@ -152,19 +152,13 @@ fn udp_clone_two_write() {
152
let (done, rx) = channel();
153
let tx2 = tx.clone();
154
let _t = thread::spawn(move || {
155
- match sock3.send_to(&[1], &addr2) {
156
- Ok(..) => {
157
- let _ = tx2.send(());
158
- }
159
- Err(..) => {}
+ if sock3.send_to(&[1], &addr2).is_ok() {
+ let _ = tx2.send(());
160
}
161
done.send(()).unwrap();
162
});
163
- match sock1.send_to(&[2], &addr2) {
164
165
- let _ = tx.send(());
166
167
+ if sock1.send_to(&[2], &addr2).is_ok() {
+ let _ = tx.send(());
168
169
drop(tx);
170
0 commit comments