summaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-12-27 15:08:50 +0200
committerLars Wirzenius <liw@liw.fi>2020-12-27 15:08:50 +0200
commit619b0471182daf42615558a4449b3156541944f8 (patch)
tree72cd3cd0a84a4e07e4da3af44764cc39fd5ae356 /src/cmd
parentbbde1bfd90edaa49463d7c3950ddcaa834e9ce02 (diff)
downloadobnam2-619b0471182daf42615558a4449b3156541944f8.tar.gz
refactor: rename Generation to NascentGeneration
New name is more descriptive.
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/backup.rs4
-rw-r--r--src/cmd/restore.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/backup.rs b/src/cmd/backup.rs
index 2a294f5..c9b7fc5 100644
--- a/src/cmd/backup.rs
+++ b/src/cmd/backup.rs
@@ -1,6 +1,6 @@
use crate::client::{BackupClient, ClientConfig};
use crate::fsiter::FsIterator;
-use crate::generation::Generation;
+use crate::generation::NascentGeneration;
use indicatif::{ProgressBar, ProgressStyle};
use log::info;
use tempfile::NamedTempFile;
@@ -22,7 +22,7 @@ pub fn backup(config: &ClientConfig, buffer_size: usize) -> anyhow::Result<()> {
// Create the SQLite database using the named temporary file.
// The fetching is in its own block so that the file handles
// get closed and data flushed to disk.
- let mut gen = Generation::create(&dbname)?;
+ let mut gen = NascentGeneration::create(&dbname)?;
let progress = create_progress_bar(GUESS_FILE_COUNT, true);
progress.enable_steady_tick(100);
gen.insert_iter(FsIterator::new(&config.root).map(|entry| {
diff --git a/src/cmd/restore.rs b/src/cmd/restore.rs
index da654fd..dd7ed41 100644
--- a/src/cmd/restore.rs
+++ b/src/cmd/restore.rs
@@ -1,7 +1,7 @@
use crate::client::BackupClient;
use crate::client::ClientConfig;
use crate::fsentry::{FilesystemEntry, FilesystemKind};
-use crate::generation::Generation;
+use crate::generation::NascentGeneration;
use indicatif::{ProgressBar, ProgressStyle};
use libc::{fchmod, futimens, timespec};
use log::{debug, error, info};
@@ -37,7 +37,7 @@ pub fn restore(config: &ClientConfig, gen_id: &str, to: &Path) -> anyhow::Result
}
info!("downloaded generation to {}", dbname.display());
- let gen = Generation::open(&dbname)?;
+ let gen = NascentGeneration::open(&dbname)?;
info!("restore file count: {}", gen.file_count());
let progress = create_progress_bar(gen.file_count(), true);
for (fileid, entry) in gen.files()? {
@@ -74,7 +74,7 @@ struct Opt {
fn restore_generation(
client: &BackupClient,
- gen: &Generation,
+ gen: &NascentGeneration,
fileid: u64,
entry: &FilesystemEntry,
to: &Path,
@@ -123,7 +123,7 @@ fn restored_path(entry: &FilesystemEntry, to: &Path) -> anyhow::Result<PathBuf>
fn restore_regular(
client: &BackupClient,
- gen: &Generation,
+ gen: &NascentGeneration,
path: &Path,
fileid: u64,
entry: &FilesystemEntry,