Skip to content

Commit

Permalink
cargo fmt+clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
007 committed Aug 6, 2024
1 parent cbbb4aa commit 5318643
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/locations.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use once_cell::sync::Lazy;
use std::collections::HashMap;

pub static IATA_TO_CITY_COUNTRY: Lazy<HashMap<&'static str, (&'static str, &'static str)>> = Lazy::new(|| {
generate_iata_to_city_map()
});
pub static CCA2_TO_COUNTRY_NAME: Lazy<HashMap<&'static str, &'static str>> = Lazy::new(|| {
generate_cca2_to_full_country_name_map()
});
pub static IATA_TO_CITY_COUNTRY: Lazy<HashMap<&'static str, (&'static str, &'static str)>> =
Lazy::new(generate_iata_to_city_map);
pub static CCA2_TO_COUNTRY_NAME: Lazy<HashMap<&'static str, &'static str>> =
Lazy::new(generate_cca2_to_full_country_name_map);

// all cloudflare IATAs to cities (defined at https://speed.cloudflare.com/locations)
pub fn generate_iata_to_city_map() -> HashMap<&'static str, (&'static str, &'static str)> {
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ fn print_test_preamble() {
"Server Location:",
cf_colo,
colo_info.0,
locations::CCA2_TO_COUNTRY_NAME.get(colo_info.1).unwrap_or(&"UNKNOWN")
locations::CCA2_TO_COUNTRY_NAME
.get(colo_info.1)
.unwrap_or(&"UNKNOWN")
);

println!("{:<32} {:.2}ms\n", "Latency (HTTP):", latency.as_millis());
Expand Down

0 comments on commit 5318643

Please sign in to comment.