diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-06-23 14:14:39 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-07-04 19:29:02 +0200 |
commit | ac0d22e4799d4f0baa43b833f02b16b3e58ee1b8 (patch) | |
tree | 593c4ffb7e8945eec4bf09009036fab855f0b364 /libimagref | |
parent | 130ea0db1381c6c0ae12f11c4f4fb53d72937cfa (diff) |
Impl Ref::fs_link_exists()
Diffstat (limited to 'libimagref')
-rw-r--r-- | libimagref/src/reference.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libimagref/src/reference.rs b/libimagref/src/reference.rs index 084464b8..1301d19a 100644 --- a/libimagref/src/reference.rs +++ b/libimagref/src/reference.rs @@ -194,8 +194,8 @@ impl<'a> Ref<'a> { } /// check whether the pointer the Ref represents still points to a file which exists - pub fn fs_link_exists(&self) -> bool { - unimplemented!() + pub fn fs_link_exists(&self) -> Result<bool> { + self.fs_file().map(|pathbuf| pathbuf.exists()) } /// Alias for `r.fs_link_exists() && r.deref().is_file()` @@ -209,8 +209,8 @@ impl<'a> Ref<'a> { } /// Alias for `!Ref::fs_link_exists()` - pub fn is_dangling(&self) -> bool { - !self.fs_link_exists() + pub fn is_dangling(&self) -> Result<bool> { + self.fs_link_exists().map(|b| !b) } /// check whether the pointer the Ref represents is valid |