From 2bef06c7fffdc43bd63fb33dd800dda48b5538b1 Mon Sep 17 00:00:00 2001 From: Leo Dutra Date: Mon, 26 Oct 2020 05:35:23 -0300 Subject: [PATCH] Use static country references --- Cargo.toml | 2 +- README.md | 2 +- src/countries.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 14ae076..5bebf10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "country-emoji" edition = "2018" -version = "0.1.1" +version = "0.1.2" description = "Converts between country names, ISO 3166-1 codes and flag emojis." readme = "README.md" keywords = ["emoji", "country", "flags", "ISO-3166-1", "BCP-47"] diff --git a/README.md b/README.md index 2663ef1..65d358e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# country-emoji +# country-emoji [![crate.io](https://img.shields.io/crates/v/country-emoji)](https://crates.io/crates/country-emoji) diff --git a/src/countries.rs b/src/countries.rs index 1b1e76b..523f80e 100644 --- a/src/countries.rs +++ b/src/countries.rs @@ -252,6 +252,6 @@ lazy_static! { Country { code: "ZW", names: vec!["Zimbabwe", "Zimbabwean"] }, ]; - pub (crate) static ref COUNTRIES_MAP: HashMap<&'static str, Country> = - COUNTRIES.iter().cloned().map(|country| (country.code, country)).collect(); + pub (crate) static ref COUNTRIES_MAP: HashMap<&'static str, &'static Country> = + COUNTRIES.iter().map(|country| (country.code, country)).collect(); }