From 9604f94f178ae609def7e5187f49ff2872e98b9e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 24 Jun 2016 17:01:40 +0200 Subject: [PATCH] Impl Ref::fs_link_valid() --- libimagref/src/reference.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libimagref/src/reference.rs b/libimagref/src/reference.rs index 9340632a..6a647aba 100644 --- a/libimagref/src/reference.rs +++ b/libimagref/src/reference.rs @@ -212,8 +212,13 @@ impl<'a> Ref<'a> { /// This includes: /// - Hashsum of the file is still the same as stored in the Ref /// - file permissions are still valid - pub fn fs_link_valid(&self) -> bool { - unimplemented!() + pub fn fs_link_valid(&self) -> Result { + match (self.fs_link_valid_permissions(), self.fs_link_valid_hash()) { + (Ok(true) , Ok(true)) => Ok(true), + (Ok(_) , Ok(_)) => Ok(false), + (Err(e) , _) => Err(e), + (_ , Err(e)) => Err(e), + } } /// Check whether the file permissions of the referenced file are equal to the stored