Fix check when not connected
This commit is contained in:
parent
c77ecbfe5d
commit
2e69cfe104
1 changed files with 4 additions and 2 deletions
|
|
@ -63,7 +63,7 @@ struct Locations {
|
|||
struct CheckResult {
|
||||
connected: bool,
|
||||
ip: String, // XXX
|
||||
location: String,
|
||||
location: Option<String>,
|
||||
}
|
||||
|
||||
#[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(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue