Skip to content

Commit ace8389

Browse files
committed
lint: clippy
1 parent 7dd5a02 commit ace8389

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tunnel/server/utils.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl AllowReverseTunnelConfig {
139139
}
140140

141141
match &remote.host {
142-
Host::Domain(_) => return false,
142+
Host::Domain(_) => false,
143143
Host::Ipv4(ip) => self.cidr.iter().any(|cidr| cidr.contains(&IpAddr::from(*ip))),
144144
Host::Ipv6(ip) => self.cidr.iter().any(|cidr| cidr.contains(&IpAddr::from(*ip))),
145145
}
@@ -162,7 +162,7 @@ impl AllowTunnelConfig {
162162
}
163163

164164
match &remote.host {
165-
Host::Domain(host) => return self.host.is_match(host),
165+
Host::Domain(host) => self.host.is_match(host),
166166
Host::Ipv4(ip) => self.cidr.iter().any(|cidr| cidr.contains(&IpAddr::from(*ip))),
167167
Host::Ipv6(ip) => self.cidr.iter().any(|cidr| cidr.contains(&IpAddr::from(*ip))),
168168
}
@@ -385,6 +385,8 @@ mod tests {
385385
host: Host::Ipv4([127, 0, 0, 1].into()),
386386
port: 80,
387387
};
388+
assert!(!config.is_allowed(&remote));
389+
assert!(!AllowConfig::from(config.clone()).is_allowed(&remote));
388390

389391
// host is domain
390392
let remote = RemoteAddr {

0 commit comments

Comments
 (0)