diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-01-05 14:31:23 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-01-05 14:31:23 +0200 |
commit | c2f7b5af1b9a237c740c71b3b65a155a8440cf3a (patch) | |
tree | f2db3d57cbd6db1e68779907f1477dca315220c5 /src/cmd/restore.rs | |
parent | fee70c974049560164d8950dabc63554f55671b1 (diff) | |
download | obnam2-c2f7b5af1b9a237c740c71b3b65a155a8440cf3a.tar.gz |
refactor: add BackedUpFile to avoid using a tuple
The struct is easier to use right.
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 0efdffb..c882e21 100644 --- a/src/cmd/restore.rs +++ b/src/cmd/restore.rs @@ -35,12 +35,12 @@ 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()?, true); - for (fileid, entry, _) in gen.files()? { - restore_generation(&client, &gen, fileid, &entry, &to, &progress)?; + for file in gen.files()? { + restore_generation(&client, &gen, file.fileno(), file.entry(), &to, &progress)?; } - for (_, entry, _) in gen.files()? { - if entry.is_dir() { - restore_directory_metadata(&entry, &to)?; + for file in gen.files()? { + if file.entry().is_dir() { + restore_directory_metadata(file.entry(), &to)?; } } progress.finish(); |