Skip to content

Commit

Permalink
geocode: use PathBuf in download_file call; remove unneeded progres…
Browse files Browse the repository at this point in the history
…sbar.is_hidden check
  • Loading branch information
jqnatividad committed Aug 31, 2023
1 parent b9408cb commit e7e68a8
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/cmd/geocode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,24 +594,21 @@ async fn load_engine(geocode_index_file: PathBuf, progressbar: &ProgressBar) ->

if index_file.exists() {
// load existing local index
if !progressbar.is_hidden() {
progressbar.println(format!(
"Loading existing Geonames index from {}",
index_file.display()
));
}
progressbar.println(format!(
"Loading existing Geonames index from {}",
index_file.display()
));
} else {
// initial load, download index file from qsv releases
if !progressbar.is_hidden() {
progressbar.println(format!(
"Downloading default Geonames index for qsv {QSV_VERSION} release..."
));
}
progressbar.println(format!(
"Downloading default Geonames index for qsv {QSV_VERSION} release..."
));

util::download_file(
&format!(
"https://github.com/jqnatividad/qsv/releases/download/{QSV_VERSION}/qsv-{QSV_VERSION}-geocode-index.bincode"
),
&geocode_index_file.to_string_lossy(),
geocode_index_file.clone(),
!progressbar.is_hidden(),
None,
None,
Expand Down

0 comments on commit e7e68a8

Please sign in to comment.