mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-08 07:37:41 +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).
|
// This ugliness is due to the way Interest is implemented (as a NonZeroU8 wrapper).
|
||||||
let interest;
|
let interest = match (state.wait_read, state.wait_write) {
|
||||||
if state.wait_read && !state.wait_write {
|
(true, false) => Interest::READABLE,
|
||||||
interest = Interest::READABLE;
|
(false, true) => Interest::WRITABLE,
|
||||||
} else if state.wait_write && !state.wait_read {
|
(true, true) => Interest::READABLE | Interest::WRITABLE,
|
||||||
interest = Interest::WRITABLE;
|
(false, false) => Interest::READABLE | Interest::WRITABLE,
|
||||||
} else {
|
};
|
||||||
interest = Interest::READABLE | Interest::WRITABLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
poll.registry().register(&mut state.mio_stream, state.token, interest)?;
|
poll.registry().register(&mut state.mio_stream, state.token, interest)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue