diff options
Diffstat (limited to 'lib/domain/libimagnotes')
-rw-r--r-- | lib/domain/libimagnotes/Cargo.toml | 1 | ||||
-rw-r--r-- | lib/domain/libimagnotes/src/lib.rs | 1 | ||||
-rw-r--r-- | lib/domain/libimagnotes/src/note.rs | 6 |
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/domain/libimagnotes/Cargo.toml b/lib/domain/libimagnotes/Cargo.toml index d3616cde..3b19375a 100644 --- a/lib/domain/libimagnotes/Cargo.toml +++ b/lib/domain/libimagnotes/Cargo.toml @@ -17,6 +17,7 @@ homepage = "http://imag-pim.org" semver = "0.5" log = "0.3" toml = "^0.4" +toml-query = "0.3.0" libimagstore = { version = "0.4.0", path = "../../../lib/core/libimagstore" } libimagerror = { version = "0.4.0", path = "../../../lib/core/libimagerror" } diff --git a/lib/domain/libimagnotes/src/lib.rs b/lib/domain/libimagnotes/src/lib.rs index 10ef952b..3fa1f5d2 100644 --- a/lib/domain/libimagnotes/src/lib.rs +++ b/lib/domain/libimagnotes/src/lib.rs @@ -36,6 +36,7 @@ #[macro_use] extern crate log; extern crate semver; extern crate toml; +extern crate toml_query; extern crate libimagrt; #[macro_use] extern crate libimagstore; diff --git a/lib/domain/libimagnotes/src/note.rs b/lib/domain/libimagnotes/src/note.rs index cc50bab8..74991146 100644 --- a/lib/domain/libimagnotes/src/note.rs +++ b/lib/domain/libimagnotes/src/note.rs @@ -30,7 +30,9 @@ use libimagstore::storeid::StoreId; use libimagstore::storeid::StoreIdIterator; use libimagstore::store::FileLockEntry; use libimagstore::store::Store; -use libimagstore::toml_ext::TomlValueExt; + +use toml_query::read::TomlValueReadExt; +use toml_query::set::TomlValueSetExt; use module_path::ModuleEntryPath; use result::Result; @@ -92,7 +94,7 @@ impl<'a> Note<'a> { pub fn get_name(&self) -> Result<String> { let header = self.entry.get_header(); match header.read("note.name") { - Ok(Some(Value::String(s))) => Ok(String::from(s)), + Ok(Some(&Value::String(ref s))) => Ok(s.clone()), Ok(_) => { let e = NE::new(NEK::HeaderTypeError, None); Err(NE::new(NEK::StoreReadError, Some(Box::new(e)))) |