Skip to content

Commit

Permalink
next().or_else()
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Oct 28, 2024
1 parent 12bb957 commit d23aa74
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions neqo-bin/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,12 @@ impl ServerRunner {
input_dgrams = socket.recv(*host, &mut self.recv_buf)?;
}
// Then take the first datagram, if any.
input_dgrams.iter_mut().flatten().next().map_or_else(
|| {
// Reading from the socket returned no datagrams. Don't try again.
ready_socket_index = None;
input_dgrams = None;
None
},
Some,
)
input_dgrams.iter_mut().flatten().next().or_else(|| {
// Reading from the socket returned no datagrams. Don't try again.
ready_socket_index = None;
input_dgrams = None;
None
})
};

// Have server process in- and output datagrams.
Expand Down

0 comments on commit d23aa74

Please sign in to comment.