chore: update Rust to 2024 edition (#2066)

This commit is contained in:
Luna Yao
2026-04-09 18:22:12 +02:00
committed by GitHub
parent a8feb9ac2b
commit a879dd1b14
158 changed files with 1327 additions and 1231 deletions
+8 -6
View File
@@ -15,18 +15,18 @@ use crate::{
log,
},
instance::proxy_cidrs_monitor::ProxyCidrsMonitor,
peers::{peer_manager::PeerManager, recv_packet_from_chan, PacketRecvChanReceiver},
peers::{PacketRecvChanReceiver, peer_manager::PeerManager, recv_packet_from_chan},
tunnel::{
common::{reserve_buf, FramedWriter, TunnelWrapper, ZCPacketToBytes},
packet_def::{ZCPacket, ZCPacketType, TAIL_RESERVED_SIZE},
StreamItem, Tunnel, TunnelError, ZCPacketSink, ZCPacketStream,
common::{FramedWriter, TunnelWrapper, ZCPacketToBytes, reserve_buf},
packet_def::{TAIL_RESERVED_SIZE, ZCPacket, ZCPacketType},
},
};
use byteorder::WriteBytesExt as _;
use bytes::{BufMut, BytesMut};
use cidr::{Ipv4Inet, Ipv6Inet};
use futures::{lock::BiLock, ready, SinkExt, Stream, StreamExt};
use futures::{SinkExt, Stream, StreamExt, lock::BiLock, ready};
use pin_project_lite::pin_project;
use pnet::packet::{ipv4::Ipv4Packet, ipv6::Ipv6Packet};
use tokio::{
@@ -530,7 +530,9 @@ impl VirtualNic {
Ok(_) => tracing::info!("add_self_to_firewall_allowlist successful!"),
Err(error) => {
log::warn!(%error, "Failed to add Easytier to firewall allowlist, Subnet proxy and KCP proxy may not work properly.");
log::warn!("You can add firewall rules manually, or use --use-smoltcp to run with user-space TCP/IP stack.");
log::warn!(
"You can add firewall rules manually, or use --use-smoltcp to run with user-space TCP/IP stack."
);
}
}
@@ -768,7 +770,7 @@ impl VirtualNic {
Ok(())
}
pub fn get_ifcfg(&self) -> impl IfConfiguerTrait {
pub fn get_ifcfg(&self) -> impl IfConfiguerTrait + use<> {
IfConfiger {}
}
}