summaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/backup.rs4
-rw-r--r--src/cmd/restore.rs10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/backup.rs b/src/cmd/backup.rs
index 2a8e086..4d13fe7 100644
--- a/src/cmd/backup.rs
+++ b/src/cmd/backup.rs
@@ -51,7 +51,7 @@ pub fn backup(config: &ClientConfig, buffer_size: usize) -> anyhow::Result<()> {
Some(old) => {
info!("incremental backup based on {}", old);
let old = client.fetch_generation(&old, &oldname)?;
- progress.set_length(old.file_count()?.into());
+ progress.set_length(old.file_count()? as u64);
new.insert_iter(iter.map(|entry| {
progress.inc(1);
match entry {
@@ -76,7 +76,7 @@ pub fn backup(config: &ClientConfig, buffer_size: usize) -> anyhow::Result<()> {
}))?;
}
}
- progress.set_length(new.file_count());
+ progress.set_length(new.file_count() as u64);
progress.finish();
}
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()
};