diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-06-14 10:48:36 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-06-19 11:37:10 +0300 |
commit | 40e4db6600d53a8bb231f9629173fa4fc3b4437e (patch) | |
tree | 86cb8057e966fae8eec2a494cf835a9f266bebe0 | |
parent | c7c651ca34af0f99e64ef4b65911a294078fb9ab (diff) | |
download | obnam2-40e4db6600d53a8bb231f9629173fa4fc3b4437e.tar.gz |
chore: bump dependency on indicatif to 0.16, and fix what's needed
Change calls to set_message to pass ownership of the message, rather
than just letting it borrow the message.
Sponsored-by: author
-rw-r--r-- | Cargo.lock | 10 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/backup_progress.rs | 5 | ||||
-rw-r--r-- | src/cmd/restore.rs | 2 |
4 files changed, 8 insertions, 11 deletions
@@ -212,9 +212,7 @@ dependencies = [ "encode_unicode", "lazy_static", "libc", - "regex", "terminal_size", - "unicode-width", "winapi", ] @@ -692,9 +690,9 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.15.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" +checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" dependencies = [ "console", "lazy_static", @@ -947,9 +945,9 @@ dependencies = [ [[package]] name = "number_prefix" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "obnam" @@ -16,7 +16,7 @@ anyhow = "1" bytesize = "1" chrono = "0.4" directories-next = "2" -indicatif = "0.15" +indicatif = "0.16" libc = "0.2" log = "0.4" log4rs = "1" diff --git a/src/backup_progress.rs b/src/backup_progress.rs index 6035eff..fd07978 100644 --- a/src/backup_progress.rs +++ b/src/backup_progress.rs @@ -63,7 +63,7 @@ impl BackupProgress { let parts = vec!["{msg}", "elapsed: {elapsed}", "{spinner}"]; progress.set_style(ProgressStyle::default_bar().template(&parts.join("\n"))); progress.enable_steady_tick(100); - progress.set_message(&format!( + progress.set_message(format!( "downloading previous generation metadata: {}", gen_id )); @@ -84,8 +84,7 @@ impl BackupProgress { if self.progress.length() < self.progress.position() { self.progress.set_length(self.progress.position()); } - self.progress - .set_message(&format!("{}", filename.display())); + self.progress.set_message(format!("{}", filename.display())); } pub fn finish(&self) { diff --git a/src/cmd/restore.rs b/src/cmd/restore.rs index 3c5b896..0e349c2 100644 --- a/src/cmd/restore.rs +++ b/src/cmd/restore.rs @@ -129,7 +129,7 @@ fn restore_generation( progress: &ProgressBar, ) -> RestoreResult<()> { info!("restoring {:?}", entry); - progress.set_message(&format!("{}", entry.pathbuf().display())); + progress.set_message(format!("{}", entry.pathbuf().display())); progress.inc(1); let to = restored_path(entry, to)?; |