diff --git a/src/main.rs b/src/main.rs index 733fd4b..54e8142 100644 --- a/src/main.rs +++ b/src/main.rs @@ -63,7 +63,7 @@ struct Locations { struct CheckResult { connected: bool, ip: String, // XXX - location: String, + location: Option, } #[derive(Serialize, Deserialize, Debug)] @@ -161,7 +161,9 @@ fn check(opts: &Opts) -> Result<(), anyhow::Error> { } else { println!("Connected: {:?}", result.connected); println!("IP: {}", result.ip); - println!("Location: {}", result.location); + if let Some(location) = result.location { + println!("Location: {}", location); + } } Ok(()) }