summaryrefslogtreecommitdiffstats
path: root/src/commands/source.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-05-17 13:58:10 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-05-17 13:59:44 +0200
commitddbd9629b3188c9f08d023829683c40ab9e1448b (patch)
tree8ebcf47cb5d54b1f2e843bf760a8f9f260a8fb26 /src/commands/source.rs
parentf9a2d04b50c566ff762b3f450b444cf6c6757715 (diff)
Revert "Update dependency: indicatif 0.15 -> 0.16"
This reverts the dependency update because indicatif 0.16 introduced a reachable `unreachable!()` statement in their sourcecode that we actually hit if we `--hide-bars`. This reverts commit 6ceccb679d9c2d19389c6c6eef792d8db9086f31. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/commands/source.rs')
-rw-r--r--src/commands/source.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/commands/source.rs b/src/commands/source.rs
index cd33921..2e4ee2b 100644
--- a/src/commands/source.rs
+++ b/src/commands/source.rs
@@ -245,7 +245,7 @@ pub async fn download(
.map(|p| {
sc.sources_for(p).into_iter().map(|source| {
let bar = multi.add(progressbars.spinner());
- bar.set_message(format!("Downloading {}", source.url()));
+ bar.set_message(&format!("Downloading {}", source.url()));
async move {
let source_path_exists = source.path().exists();
if !source_path_exists && source.download_manually() {
@@ -273,7 +273,7 @@ pub async fn download(
let response = match reqwest::get(source.url().as_ref()).await {
Ok(resp) => resp,
Err(e) => {
- bar.finish_with_message(format!("Failed: {}", source.url()));
+ bar.finish_with_message(&format!("Failed: {}", source.url()));
return Err(e).with_context(|| anyhow!("Downloading '{}'", source.url()))
}
};
@@ -291,9 +291,9 @@ pub async fn download(
bar.inc(bytes.len() as u64);
if let Some(len) = response.content_length() {
- bar.set_message(format!("Downloading {} ({}/{} bytes)", source.url(), bytes_written, len));
+ bar.set_message(&format!("Downloading {} ({}/{} bytes)", source.url(), bytes_written, len));
} else {
- bar.set_message(format!("Downloading {} ({} bytes)", source.url(), bytes_written));
+ bar.set_message(&format!("Downloading {} ({} bytes)", source.url(), bytes_written));
}
}
@@ -305,17 +305,17 @@ pub async fn download(
if source_path_exists /* && force is implied by 'if' above*/ {
if let Err(e) = source.remove_file().await {
- bar.finish_with_message(format!("Failed to remove existing file: {}", source.path().display()));
+ bar.finish_with_message(&format!("Failed to remove existing file: {}", source.path().display()));
return Err(e)
}
}
if let Err(e) = perform_download(&source, &bar).await {
- bar.finish_with_message(format!("Failed: {}", source.url()));
+ bar.finish_with_message(&format!("Failed: {}", source.url()));
Err(e)
} else {
- bar.finish_with_message(format!("Finished: {}", source.url()));
+ bar.finish_with_message(&format!("Finished: {}", source.url()));
Ok(())
}
}