diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-01-12 16:32:18 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-01-13 01:14:03 +0100 |
commit | a34cae03e5732e025e449b01a1b89a442d26aeb4 (patch) | |
tree | 56a7ff512d9d4b5cd2b8523be3e9f731762e4f28 /lib/entry/libimagentryref/src/util.rs | |
parent | e9ae81a2ce99a86035f68ec8c4ef335a3a4221aa (diff) |
libimagentryref: Replace read with typed read
Diffstat (limited to 'lib/entry/libimagentryref/src/util.rs')
-rw-r--r-- | lib/entry/libimagentryref/src/util.rs | 8 |
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) } |