Skip to content

Commit 075c7ef

Browse files
thomaseizingerdjc
authored andcommitted
refactor(quinn-udp): avoid blocks in match arms
By moving the comment on top of the match-arm, we can avoid using a block for it.
1 parent 3391e7a commit 075c7ef

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

quinn-udp/src/unix.rs

+6-12
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,8 @@ fn send(
338338

339339
let e = io::Error::last_os_error();
340340
match e.kind() {
341-
io::ErrorKind::Interrupted => {
342-
// Retry the transmission
343-
continue;
344-
}
341+
// Retry the transmission
342+
io::ErrorKind::Interrupted => continue,
345343
io::ErrorKind::WouldBlock => return Err(e),
346344
_ => {
347345
// Some network adapters and drivers do not support GSO. Unfortunately, Linux
@@ -425,10 +423,8 @@ fn send(state: &UdpSocketState, io: SockRef<'_>, transmit: &Transmit<'_>) -> io:
425423

426424
let e = io::Error::last_os_error();
427425
match e.kind() {
428-
io::ErrorKind::Interrupted => {
429-
// Retry the transmission
430-
continue;
431-
}
426+
// Retry the transmission
427+
io::ErrorKind::Interrupted => continue,
432428
io::ErrorKind::WouldBlock => return Err(e),
433429
_ => return Err(e),
434430
}
@@ -459,10 +455,8 @@ fn send(state: &UdpSocketState, io: SockRef<'_>, transmit: &Transmit<'_>) -> io:
459455

460456
let e = io::Error::last_os_error();
461457
match e.kind() {
462-
io::ErrorKind::Interrupted => {
463-
// Retry the transmission
464-
continue;
465-
}
458+
// Retry the transmission
459+
io::ErrorKind::Interrupted => continue,
466460
io::ErrorKind::WouldBlock => return Err(e),
467461
_ => return Err(e),
468462
}

0 commit comments

Comments
 (0)