Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ibigbug committed Oct 1, 2024
1 parent 730ac7d commit 3934720
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions clash_lib/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ impl SocksAddrType {

impl SocksAddr {
pub fn any_ipv4() -> Self {
Self::Ip("0.0.0.0:0".parse().unwrap())
Self::Ip(SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 0))
}

pub fn any_ipv6() -> Self {
Self::Ip("[::]:0".parse().unwrap())
Self::Ip(SocketAddr::new(
IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)),
0,
))
}

pub fn write_buf<T: BufMut>(&self, buf: &mut T) {
Expand Down Expand Up @@ -369,6 +372,7 @@ pub enum Type {
HttpConnect,
Socks5,
Tun,
#[cfg(target_os = "linux")]
Tproxy,

Ignore,
Expand Down

0 comments on commit 3934720

Please sign in to comment.