Skip to content

Commit

Permalink
use unwrap_or
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Jul 25, 2023
1 parent fec2bce commit 0a4cfc4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tokio/src/io/interest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,13 @@ impl Interest {
mio_add(&mut mio, mio::Interest::READABLE);
}

// we should now always have a valid mio interest: either an tokio interest with a
// corresponding mio interest was used, or - if only the error interest was specified -
// we've picked a default interest.
match mio {
Some(inner) => inner,
None => unreachable!("no mio interest is specified"),
}
// the default `mio::Interest::READABLE` should never be used in practice. Either
//
// - at least one tokio interest with a mio counterpart was used
// - only the error tokio interest was specified
//
// in both cases, `mio` is Some already
mio.unwrap_or(mio::Interest::READABLE)
}

pub(crate) fn mask(self) -> Ready {
Expand Down

0 comments on commit 0a4cfc4

Please sign in to comment.