From c2f9149461e196bc56e322387c9723d72dc9f1f9 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Thu, 27 Feb 2020 17:12:56 +0100 Subject: [PATCH] catalog: introduce is_symlink() to check if DirEntry is a symlink. Signed-off-by: Christian Ebner --- src/backup/catalog.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backup/catalog.rs b/src/backup/catalog.rs index a8f11776..8f6b6128 100644 --- a/src/backup/catalog.rs +++ b/src/backup/catalog.rs @@ -112,6 +112,14 @@ impl DirEntry { _ => false, } } + + /// Check if DirEntry is a symlink + pub fn is_symlink(&self) -> bool { + match self.attr { + DirEntryAttribute::Symlink { .. } => true, + _ => false, + } + } } struct DirInfo {