Skip to content

Commit be8d4cb

Browse files
committed
fmt
1 parent ace0268 commit be8d4cb

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

vnt/src/channel/punch.rs

+11-12
Original file line numberDiff line numberDiff line change
@@ -268,16 +268,15 @@ impl Punch {
268268
}
269269
let device_info = self.current_device.load();
270270

271-
nat_info.public_ips.retain(|ip| {
272-
is_ipv4_global(ip)
273-
&& device_info.not_in_network(*ip)
274-
});
271+
nat_info
272+
.public_ips
273+
.retain(|ip| is_ipv4_global(ip) && device_info.not_in_network(*ip));
275274
nat_info.public_ports.retain(|port| *port != 0);
276275
nat_info.udp_ports.retain(|port| *port != 0);
277276

278-
nat_info.local_ipv4 = nat_info.local_ipv4.filter(|ip| {
279-
device_info.not_in_network(*ip)
280-
});
277+
nat_info.local_ipv4 = nat_info
278+
.local_ipv4
279+
.filter(|ip| device_info.not_in_network(*ip));
281280

282281
if punch_tcp && self.punch_model.use_tcp() && nat_info.tcp_port != 0 {
283282
//向tcp发起连接
@@ -383,11 +382,11 @@ impl Punch {
383382
}
384383
let mut index = start
385384
+ self.punch_symmetric(
386-
&self.port_vec[start..end],
387-
buf,
388-
&nat_info.public_ips,
389-
max_k2,
390-
)?;
385+
&self.port_vec[start..end],
386+
buf,
387+
&nat_info.public_ips,
388+
max_k2,
389+
)?;
391390
if index >= self.port_vec.len() {
392391
index = 0
393392
}

0 commit comments

Comments
 (0)