diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-01-01 18:10:21 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-01-01 18:10:21 +0000 |
commit | e6a4eb6edf83a68a6f73094126804beb0c569937 (patch) | |
tree | 4d32fa1f41f3db39dd6ab169df2c6cfffe3e002e /src/cmd/restore.rs | |
parent | a7336cfa6cb3f5de69c994a5e61868d49756b1ad (diff) | |
parent | 5b204985983a9652d03d648fa24eb8e6fd37dfe7 (diff) | |
download | obnam2-e6a4eb6edf83a68a6f73094126804beb0c569937.tar.gz |
Merge branch 'sqlookup2' into 'main'
SQL lookup
See merge request larswirzenius/obnam!55
Diffstat (limited to 'src/cmd/restore.rs')
-rw-r--r-- | src/cmd/restore.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/restore.rs b/src/cmd/restore.rs index a3594ea..53e168a 100644 --- a/src/cmd/restore.rs +++ b/src/cmd/restore.rs @@ -34,7 +34,7 @@ pub fn restore(config: &ClientConfig, gen_ref: &str, to: &Path) -> anyhow::Resul let gen = client.fetch_generation(&gen_id, &dbname)?; info!("restore file count: {}", gen.file_count()?); - let progress = create_progress_bar(gen.file_count()?.into(), true); + let progress = create_progress_bar(gen.file_count()?, true); for (fileid, entry) in gen.files()? { restore_generation(&client, &gen, fileid, &entry, &to, &progress)?; } @@ -70,7 +70,7 @@ struct Opt { fn restore_generation( client: &BackupClient, gen: &LocalGeneration, - fileid: u64, + fileid: i64, entry: &FilesystemEntry, to: &Path, progress: &ProgressBar, @@ -120,7 +120,7 @@ fn restore_regular( client: &BackupClient, gen: &LocalGeneration, path: &Path, - fileid: u64, + fileid: i64, entry: &FilesystemEntry, ) -> anyhow::Result<()> { debug!("restoring regular {}", path.display()); @@ -191,9 +191,9 @@ fn restore_metadata(path: &Path, entry: &FilesystemEntry) -> anyhow::Result<()> Ok(()) } -fn create_progress_bar(file_count: u64, verbose: bool) -> ProgressBar { +fn create_progress_bar(file_count: i64, verbose: bool) -> ProgressBar { let progress = if verbose { - ProgressBar::new(file_count) + ProgressBar::new(file_count as u64) } else { ProgressBar::hidden() }; |