Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply clippy fixes #68

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ impl RunCommand for DataCommand {

let mut sp = Spinner::with_timer(
DEFAULT_PROGRESS_SPINNER,
(DOWNLOADING_SEARCHING_STRING.to_string() + RUNNING_TAIL_STRING).into(),
DOWNLOADING_SEARCHING_STRING.to_string() + RUNNING_TAIL_STRING,
);
let popgetter = Popgetter::new_with_config(config).await?;
let search_results = popgetter.search(self.search_params_args.clone().into());

// sp.stop_and_persist is potentially a better method, but not obvious how to
// store the timing. Leaving below until that option is ruled out.
// sp.stop_and_persist(&COMPLETE_PROGRESS_STRING, spinner_message.into());
sp.stop_with_symbol(&COMPLETE_PROGRESS_STRING);
sp.stop_with_symbol(COMPLETE_PROGRESS_STRING);
print_metrics_count(search_results.clone());
if !self.force_run {
println!("Input 'r' to run query, any other character will cancel");
Expand All @@ -129,10 +129,10 @@ impl RunCommand for DataCommand {
let spinner_message = "Downloading metrics";
let mut sp = Spinner::with_timer(
DEFAULT_PROGRESS_SPINNER,
(spinner_message.to_string() + RUNNING_TAIL_STRING).into(),
spinner_message.to_string() + RUNNING_TAIL_STRING,
);
let mut data = search_results.download(&popgetter.config).await?;
sp.stop_with_symbol(&COMPLETE_PROGRESS_STRING);
sp.stop_with_symbol(COMPLETE_PROGRESS_STRING);

debug!("{data:#?}");

Expand Down Expand Up @@ -260,7 +260,7 @@ fn parse_year_range(value: &str) -> Result<Vec<YearRange>, &'static str> {
fn print_metrics_count(search_results: SearchResults) -> usize {
let len_requests = search_results.0.shape().0;
println!("Found {len_requests} metric(s).");
return len_requests;
len_requests
}

fn text_searches_from_args(
Expand Down Expand Up @@ -315,7 +315,7 @@ impl RunCommand for MetricsCommand {
);
let popgetter = Popgetter::new_with_config(config).await?;
let search_results = popgetter.search(self.search_params_args.clone().into());
sp.stop_with_symbol(&COMPLETE_PROGRESS_STRING);
sp.stop_with_symbol(COMPLETE_PROGRESS_STRING);

let len_requests = print_metrics_count(search_results.clone());

Expand Down
Loading