summaryrefslogtreecommitdiffstats
path: root/lib/entry/libimagentryref/src/util.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-01-12 16:32:18 +0100
committerMatthias Beyer <mail@beyermatthias.de>2018-01-13 01:14:03 +0100
commita34cae03e5732e025e449b01a1b89a442d26aeb4 (patch)
tree56a7ff512d9d4b5cd2b8523be3e9f731762e4f28 /lib/entry/libimagentryref/src/util.rs
parente9ae81a2ce99a86035f68ec8c4ef335a3a4221aa (diff)
libimagentryref: Replace read with typed read
Diffstat (limited to 'lib/entry/libimagentryref/src/util.rs')
-rw-r--r--lib/entry/libimagentryref/src/util.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/entry/libimagentryref/src/util.rs b/lib/entry/libimagentryref/src/util.rs
index 0055991d..ac4162fc 100644
--- a/lib/entry/libimagentryref/src/util.rs
+++ b/lib/entry/libimagentryref/src/util.rs
@@ -25,7 +25,7 @@ use error::Result;
use libimagstore::store::Entry;
-use toml_query::read::TomlValueReadExt;
+use toml_query::read::TomlValueReadTypeExt;
/// Creates a Hash from a PathBuf by making the PathBuf absolute and then running a hash
/// algorithm on it
@@ -45,10 +45,8 @@ pub fn hash_path(pb: &PathBuf) -> Result<String> {
/// Read the reference from a file
pub fn read_reference(refentry: &Entry) -> Result<PathBuf> {
refentry.get_header()
- .read("ref.path")?
- .ok_or(RE::from_kind(REK::HeaderFieldMissingError))?
- .as_str()
- .ok_or(RE::from_kind(REK::HeaderTypeError))
+ .read_string("ref.path")?
+ .ok_or(RE::from_kind(REK::HeaderFieldMissingError))
.map(PathBuf::from)
}