mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-20 22:09:09 +00:00
Apply clippy suggestions
This commit is contained in:
parent
0be38b6481
commit
53458fe84f
2 changed files with 2 additions and 4 deletions
|
@ -256,7 +256,6 @@ impl<'a> TunToProxy<'a> {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.consume(slice.len(), |buf| {
|
.consume(slice.len(), |buf| {
|
||||||
buf[..].clone_from_slice(slice);
|
buf[..].clone_from_slice(slice);
|
||||||
()
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -443,7 +442,6 @@ impl<'a> TunToProxy<'a> {
|
||||||
while let Some((rx_token, _)) = self.tun.receive(Instant::now()) {
|
while let Some((rx_token, _)) = self.tun.receive(Instant::now()) {
|
||||||
rx_token.consume(|frame| {
|
rx_token.consume(|frame| {
|
||||||
self.receive_tun(frame);
|
self.receive_tun(frame);
|
||||||
()
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ pub struct VirtRxToken {
|
||||||
buffer: Vec<u8>,
|
buffer: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> phy::RxToken for VirtRxToken {
|
impl phy::RxToken for VirtRxToken {
|
||||||
fn consume<R, F>(mut self, f: F) -> R
|
fn consume<R, F>(mut self, f: F) -> R
|
||||||
where
|
where
|
||||||
F: FnOnce(&mut [u8]) -> R,
|
F: FnOnce(&mut [u8]) -> R,
|
||||||
|
@ -69,7 +69,7 @@ impl Device for VirtualTunDevice {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> VirtualTunDevice {
|
impl VirtualTunDevice {
|
||||||
pub fn new(capabilities: DeviceCapabilities) -> Self {
|
pub fn new(capabilities: DeviceCapabilities) -> Self {
|
||||||
Self {
|
Self {
|
||||||
capabilities,
|
capabilities,
|
||||||
|
|
Loading…
Add table
Reference in a new issue