summaryrefslogtreecommitdiffstats
path: root/lib/entry/libimagentrylink/src/external.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-08-26 17:53:08 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-08-28 12:22:37 +0200
commitc0c62bd1b5c5b9ece1d8289721dc8617987a7885 (patch)
tree34b1acf7872eb10db152c0c1a9bf96bf52027e4a /lib/entry/libimagentrylink/src/external.rs
parent3024fefcb9d338919e0a3b5b1b90fb77d2313330 (diff)
Change crates to use toml-query crate
Diffstat (limited to 'lib/entry/libimagentrylink/src/external.rs')
-rw-r--r--lib/entry/libimagentrylink/src/external.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/entry/libimagentrylink/src/external.rs b/lib/entry/libimagentrylink/src/external.rs
index daed7a12..8ebd060d 100644
--- a/lib/entry/libimagentrylink/src/external.rs
+++ b/lib/entry/libimagentrylink/src/external.rs
@@ -39,9 +39,11 @@ use libimagstore::store::FileLockEntry;
use libimagstore::store::Store;
use libimagstore::storeid::StoreId;
use libimagstore::storeid::IntoStoreId;
-use libimagstore::toml_ext::TomlValueExt;
use libimagutil::debug_result::*;
+use toml_query::read::TomlValueReadExt;
+use toml_query::set::TomlValueSetExt;
+
use error::LinkError as LE;
use error::LinkErrorKind as LEK;
use error::MapErrInto;
@@ -73,7 +75,7 @@ impl<'a> Link<'a> {
.read("imag.content.url")
.ok()
.and_then(|opt| match opt {
- Some(Value::String(s)) => {
+ Some(&Value::String(ref s)) => {
debug!("Found url, parsing: {:?}", s);
Url::parse(&s[..]).ok()
},
@@ -87,7 +89,7 @@ impl<'a> Link<'a> {
.read("imag.content.url");
match opt {
- Ok(Some(Value::String(s))) => {
+ Ok(Some(&Value::String(ref s))) => {
Url::parse(&s[..])
.map(Some)
.map_err(|e| LE::new(LEK::EntryHeaderReadError, Some(Box::new(e))))
@@ -351,7 +353,7 @@ impl ExternalLinker for Entry {
let mut hdr = file.deref_mut().get_header_mut();
let mut table = match hdr.read("imag.content") {
- Ok(Some(Value::Table(table))) => table,
+ Ok(Some(&Value::Table(ref table))) => table.clone(),
Ok(Some(_)) => {
warn!("There is a value at 'imag.content' which is not a table.");
warn!("Going to override this value");