mirror of
				https://github.com/dndx/phantun.git
				synced 2025-11-04 11:55:34 +08:00 
			
		
		
		
	style(fake-tcp): fix warnings
This commit is contained in:
		@@ -403,7 +403,7 @@ impl Stack {
 | 
			
		||||
    /// the connection attempt failed.
 | 
			
		||||
    pub async fn connect(&mut self, addr: SocketAddr) -> Option<Socket> {
 | 
			
		||||
        let mut rng = SmallRng::from_os_rng();
 | 
			
		||||
        for local_port in rng.gen_range(32768..=60999)..=60999 {
 | 
			
		||||
        for local_port in rng.random_range(32768..=60999)..=60999 {
 | 
			
		||||
            let local_addr = SocketAddr::new(
 | 
			
		||||
                if addr.is_ipv4() {
 | 
			
		||||
                    IpAddr::V4(self.local_ip)
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ pub enum IPPacket<'p> {
 | 
			
		||||
    V6(ipv6::Ipv6Packet<'p>),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl<'a> IPPacket<'a> {
 | 
			
		||||
impl IPPacket<'_> {
 | 
			
		||||
    pub fn get_source(&self) -> IpAddr {
 | 
			
		||||
        match self {
 | 
			
		||||
            IPPacket::V4(p) => IpAddr::V4(p.get_source()),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user