chore: clippy suggestions

This commit is contained in:
zonyitoo
2024-02-03 15:43:24 +08:00
parent 3569522e4d
commit 1ed120aebf
3 changed files with 3 additions and 3 deletions

View File

@@ -88,7 +88,7 @@ impl TunBuilder {
pub async fn build(mut self) -> io::Result<Tun> {
self.tun_config.layer(Layer::L3).up();
#[cfg(any(target_os = "linux"))]
#[cfg(target_os = "linux")]
self.tun_config.platform(|tun_config| {
// IFF_NO_PI preventing excessive buffer reallocating
tun_config.packet_information(false);

View File

@@ -538,7 +538,7 @@ impl TcpTun {
}
pub async fn drive_interface_state(&mut self, frame: &[u8]) {
if let Err(..) = self.iface_tx.send(frame.to_vec()) {
if self.iface_tx.send(frame.to_vec()).is_err() {
panic!("interface send channel closed unexpectly");
}

View File

@@ -62,7 +62,7 @@ impl Device for VirtTunDevice {
if let Ok(buffer) = self.in_buf.try_recv() {
let rx = Self::RxToken {
buffer,
phantom_device: PhantomData::default(),
phantom_device: PhantomData,
};
let tx = VirtTxToken(self);
return Some((rx, tx));