mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-21 22:39:08 +00:00
reformatting code
This commit is contained in:
parent
3720c41a6b
commit
ca5b550e44
1 changed files with 6 additions and 8 deletions
|
@ -413,14 +413,12 @@ impl<'a> TunToProxy<'a> {
|
|||
}
|
||||
|
||||
// This ugliness is due to the way Interest is implemented (as a NonZeroU8 wrapper).
|
||||
let interest;
|
||||
if state.wait_read && !state.wait_write {
|
||||
interest = Interest::READABLE;
|
||||
} else if state.wait_write && !state.wait_read {
|
||||
interest = Interest::WRITABLE;
|
||||
} else {
|
||||
interest = Interest::READABLE | Interest::WRITABLE;
|
||||
}
|
||||
let interest = match (state.wait_read, state.wait_write) {
|
||||
(true, false) => Interest::READABLE,
|
||||
(false, true) => Interest::WRITABLE,
|
||||
(true, true) => Interest::READABLE | Interest::WRITABLE,
|
||||
(false, false) => Interest::READABLE | Interest::WRITABLE,
|
||||
};
|
||||
|
||||
poll.registry().register(&mut state.mio_stream, state.token, interest)?;
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Reference in a new issue