From e903a6aaf059e9bc89649a4ee63820d89bd96d89 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Mon, 5 Sep 2022 09:33:20 -0400 Subject: [PATCH] rustfmt --- src/backends/github.rs | 9 +++++++-- src/backends/gitlab.rs | 9 +++++++-- src/backends/s3.rs | 9 +++++++-- src/lib.rs | 16 +++++++++++----- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/backends/github.rs b/src/backends/github.rs index ae50044..c9ba678 100644 --- a/src/backends/github.rs +++ b/src/backends/github.rs @@ -346,7 +346,11 @@ impl UpdateBuilder { } /// Toggle download progress bar, defaults to `off`. - pub fn set_progress_style(&mut self, progress_template: String, progress_chars: String) -> &mut Self { + pub fn set_progress_style( + &mut self, + progress_template: String, + progress_chars: String, + ) -> &mut Self { self.progress_template = progress_template; self.progress_chars = progress_chars; self @@ -573,7 +577,8 @@ impl Default for UpdateBuilder { no_confirm: false, current_version: None, target_version: None, - progress_template: "[{elapsed_precise}] [{bar:40}] {bytes}/{total_bytes} ({eta}) {msg}".to_string(), + progress_template: "[{elapsed_precise}] [{bar:40}] {bytes}/{total_bytes} ({eta}) {msg}" + .to_string(), progress_chars: "=>-".to_string(), auth_token: None, custom_url: None, diff --git a/src/backends/gitlab.rs b/src/backends/gitlab.rs index cad43a3..688ce3b 100644 --- a/src/backends/gitlab.rs +++ b/src/backends/gitlab.rs @@ -329,7 +329,11 @@ impl UpdateBuilder { } /// Set download progress style. - pub fn set_progress_style(&mut self, progress_template: String, progress_chars: String) -> &mut Self { + pub fn set_progress_style( + &mut self, + progress_template: String, + progress_chars: String, + ) -> &mut Self { self.progress_template = progress_template; self.progress_chars = progress_chars; self @@ -545,7 +549,8 @@ impl Default for UpdateBuilder { no_confirm: false, current_version: None, target_version: None, - progress_template: "[{elapsed_precise}] [{bar:40}] {bytes}/{total_bytes} ({eta}) {msg}".to_string(), + progress_template: "[{elapsed_precise}] [{bar:40}] {bytes}/{total_bytes} ({eta}) {msg}" + .to_string(), progress_chars: "=>-".to_string(), auth_token: None, } diff --git a/src/backends/s3.rs b/src/backends/s3.rs index d5c2501..3c0dcd9 100644 --- a/src/backends/s3.rs +++ b/src/backends/s3.rs @@ -174,7 +174,8 @@ impl Default for UpdateBuilder { no_confirm: false, current_version: None, target_version: None, - progress_template: "[{elapsed_precise}] [{bar:40}] {bytes}/{total_bytes} ({eta}) {msg}".to_string(), + progress_template: "[{elapsed_precise}] [{bar:40}] {bytes}/{total_bytes} ({eta}) {msg}" + .to_string(), progress_chars: "=>-".to_string(), auth_token: None, } @@ -294,7 +295,11 @@ impl UpdateBuilder { } /// Set download progress style. - pub fn set_progress_style(&mut self, progress_template: String, progress_chars: String) -> &mut Self { + pub fn set_progress_style( + &mut self, + progress_template: String, + progress_chars: String, + ) -> &mut Self { self.progress_template = progress_template; self.progress_chars = progress_chars; self diff --git a/src/lib.rs b/src/lib.rs index 0fef5ba..cea8e9a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -617,7 +617,8 @@ impl Download { show_progress: false, url: url.to_owned(), headers: reqwest::header::HeaderMap::new(), - progress_template: "[{elapsed_precise}] [{bar:40}] {bytes}/{total_bytes} ({eta}) {msg}".to_string(), + progress_template: "[{elapsed_precise}] [{bar:40}] {bytes}/{total_bytes} ({eta}) {msg}" + .to_string(), progress_chars: "=>-".to_string(), } } @@ -629,7 +630,11 @@ impl Download { } /// Set the progress style - pub fn set_progress_style(&mut self, progress_template: String, progress_chars: String) -> &mut Self { + pub fn set_progress_style( + &mut self, + progress_template: String, + progress_chars: String, + ) -> &mut Self { self.progress_template = progress_template; self.progress_chars = progress_chars; self @@ -702,9 +707,10 @@ impl Download { let pb = ProgressBar::new(size); pb.set_style( ProgressStyle::default_bar() - .template(&self.progress_template).unwrap() - .progress_chars(&self.progress_chars) - ); + .template(&self.progress_template) + .unwrap() + .progress_chars(&self.progress_chars), + ); Some(pb) } else {