Skip to content

Commit

Permalink
geocode: make --country and --languages options case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Sep 2, 2023
1 parent 3581ba8 commit d32ce06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cmd/geocode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ async fn geocode_main(args: Args) -> CliResult<()> {
.flag_languages
.to_ascii_lowercase()
.split(',')
.map(|s| s.trim().to_string())
.map(|s| s.trim().to_lowercase())
.collect::<Vec<String>>();
let languages_vec: Vec<&str> = languages_string_vec
.iter()
Expand Down Expand Up @@ -515,7 +515,7 @@ async fn geocode_main(args: Args) -> CliResult<()> {
Some(
country_list
.split(',')
.map(|s| s.trim().to_string())
.map(|s| s.trim().to_lowercase())
.collect::<Vec<String>>(),
)
} else {
Expand Down
4 changes: 2 additions & 2 deletions tests/test_geocode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn geocode_suggest_intl_country_filter() {
let mut cmd = wrk.command("geocode");
cmd.arg("suggest")
.arg("Location")
.args(["--country", "us"])
.args(["--country", "US"])
.args(["-f", "%city-admin1-country"])
.arg("data.csv");

Expand Down Expand Up @@ -139,7 +139,7 @@ fn geocode_suggest_intl_multi_country_filter() {
let mut cmd = wrk.command("geocode");
cmd.arg("suggest")
.arg("Location")
.args(["--country", "us,fr,ru"])
.args(["--country", "us,FR,ru"])
.args(["-f", "%city-admin1-country"])
.arg("data.csv");

Expand Down

0 comments on commit d32ce06

Please sign in to comment.