summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-08-09 10:45:04 +0300
committerLars Wirzenius <liw@liw.fi>2021-08-16 13:17:51 +0300
commitc2e9cd7865439ab5f0ec0b9761be6027bee880bb (patch)
treebb905c07806bbfa51a4198572229f71efdaad125
parent048c548b9b6395034f75e5f095964ea6c860e953 (diff)
downloadobnam2-c2e9cd7865439ab5f0ec0b9761be6027bee880bb.tar.gz
refactor: for clarity
Sponsored-by: author
-rw-r--r--src/backup_run.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backup_run.rs b/src/backup_run.rs
index 7e41173..f78a83b 100644
--- a/src/backup_run.rs
+++ b/src/backup_run.rs
@@ -179,7 +179,7 @@ impl<'a> BackupRun<'a> {
if entry.is_cachedir_tag && !old.is_cachedir_tag(&path)? {
new_cachedir_tags.push(path);
}
- match self.backup(entry, old).await {
+ match self.backup_if_changed(entry, old).await {
Err(err) => {
warnings.push(err);
}
@@ -202,7 +202,7 @@ impl<'a> BackupRun<'a> {
})
}
- async fn backup(
+ async fn backup_if_changed(
&self,
entry: AnnotatedFsEntry,
old: &LocalGeneration,
@@ -213,7 +213,7 @@ impl<'a> BackupRun<'a> {
let reason = self.policy.needs_backup(old, &entry.inner);
match reason {
Reason::IsNew | Reason::Changed | Reason::GenerationLookupError | Reason::Unknown => {
- Ok(backup_file(self.client, &entry, path, self.buffer_size, reason).await)
+ Ok(backup_one_entry(self.client, &entry, path, self.buffer_size, reason).await)
}
Reason::Unchanged | Reason::Skipped | Reason::FileError => {
let fileno = old.get_fileno(&entry.inner.pathbuf())?;
@@ -249,7 +249,7 @@ impl<'a> BackupRun<'a> {
}
}
-async fn backup_file(
+async fn backup_one_entry(
client: &AsyncBackupClient,
entry: &AnnotatedFsEntry,
path: &Path,