mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-02-09 01:59:16 +08:00
chore: clippy suggestions
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user