Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Sep 5, 2022
1 parent 46eb706 commit e903a6a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
9 changes: 7 additions & 2 deletions src/backends/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 7 additions & 2 deletions src/backends/gitlab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
}
Expand Down
9 changes: 7 additions & 2 deletions src/backends/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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
Expand Down
16 changes: 11 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e903a6a

Please sign in to comment.