From c2e9cd7865439ab5f0ec0b9761be6027bee880bb Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 9 Aug 2021 10:45:04 +0300 Subject: refactor: for clarity Sponsored-by: author --- src/backup_run.rs | 8 ++++---- 1 file 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, -- cgit v1.2.1