Skip to content

Commit 69963e0

Browse files
committed
fix clippy lint
1 parent 44805f4 commit 69963e0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/killswitch/network.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,12 @@ fn hex_to_cidr(hex: &str) -> Option<u8> {
490490
/// Get the public IP address by querying an external HTTP service
491491
pub fn get_public_ip() -> Result<String> {
492492
for url in ["https://trackip.net/ip", "https://checkip.amazonaws.com"] {
493-
if let Ok(output) = Command::new("curl").args(["-s", "-m", "5", url]).output() {
494-
if output.status.success() {
495-
let ip = String::from_utf8_lossy(&output.stdout).trim().to_string();
496-
if ip.parse::<IpAddr>().is_ok() {
497-
return Ok(ip);
498-
}
493+
if let Ok(output) = Command::new("curl").args(["-s", "-m", "5", url]).output()
494+
&& output.status.success()
495+
{
496+
let ip = String::from_utf8_lossy(&output.stdout).trim().to_string();
497+
if ip.parse::<IpAddr>().is_ok() {
498+
return Ok(ip);
499499
}
500500
}
501501
}

0 commit comments

Comments
 (0)