From 6e2aaf68533e5dba5c382a3236da815795b06b79 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 23 Sep 2017 21:26:03 +0200 Subject: [PATCH 01/25] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 681ae8b6..ae0413b0 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Our (long-term) goal is to > management, consists of reusable parts and integrates well with known > commandline tools. -Yes, imag is a rather ambitous project as it tries to reimplement functionality +Yes, imag is a rather ambitious project as it tries to reimplement functionality for several "personal information management aspects". It is a hobby project, keep that in mind. We try to use standards like vcard and icalendar wherever possible. From ea618ee3c7c44c50af6000fe0e8d1d6693dde918 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 23 Sep 2017 21:52:27 +0200 Subject: [PATCH 02/25] Remove unused variable --- lib/domain/libimagtodo/src/taskstore.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/domain/libimagtodo/src/taskstore.rs b/lib/domain/libimagtodo/src/taskstore.rs index 4a1dc2fe..0b9cca03 100644 --- a/lib/domain/libimagtodo/src/taskstore.rs +++ b/lib/domain/libimagtodo/src/taskstore.rs @@ -154,7 +154,7 @@ impl<'a> TaskStore<'a> for Store { } } // end if c % 2 }, - Err(e) => return Err(TE::from_kind(TEK::ImportError)), + Err(_) => return Err(TE::from_kind(TEK::ImportError)), } } Ok(()) From 5d76e7bafabe015f8b0ec96e21d64620226d7666 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Oct 2017 16:17:35 +0200 Subject: [PATCH 03/25] Use ? operator instead of try!() macro --- .../libimagstore/src/file_abstraction/fs.rs | 20 +-- .../src/file_abstraction/inmemory.rs | 6 +- .../src/file_abstraction/stdio/mapper/json.rs | 10 +- .../src/file_abstraction/stdio/mod.rs | 9 +- .../src/file_abstraction/stdio/out.rs | 2 +- lib/core/libimagstore/src/store.rs | 119 +++++++++--------- lib/core/libimagstore/src/storeid.rs | 8 +- lib/core/libimagstore/src/util.rs | 2 +- 8 files changed, 87 insertions(+), 89 deletions(-) diff --git a/lib/core/libimagstore/src/file_abstraction/fs.rs b/lib/core/libimagstore/src/file_abstraction/fs.rs index 0773a178..7dad3361 100644 --- a/lib/core/libimagstore/src/file_abstraction/fs.rs +++ b/lib/core/libimagstore/src/file_abstraction/fs.rs @@ -48,8 +48,8 @@ impl FileAbstractionInstance for FSFileAbstractionInstance { FSFileAbstractionInstance::File(ref mut f, _) => return { // We seek to the beginning of the file since we expect each // access to the file to be in a different context - try!(f.seek(SeekFrom::Start(0)) - .chain_err(|| SEK::FileNotSeeked)); + f.seek(SeekFrom::Start(0)) + .chain_err(|| SEK::FileNotSeeked)?; let mut s = String::new(); f.read_to_string(&mut s) @@ -58,7 +58,7 @@ impl FileAbstractionInstance for FSFileAbstractionInstance { .and_then(|s| Entry::from_str(id, &s)) }, FSFileAbstractionInstance::Absent(ref p) => - (try!(open_file(p).chain_err(|| SEK::FileNotFound)), p.clone()), + (open_file(p).chain_err(|| SEK::FileNotFound)?, p.clone()), }; *self = FSFileAbstractionInstance::File(file, path); if let FSFileAbstractionInstance::File(ref mut f, _) = *self { @@ -84,15 +84,15 @@ impl FileAbstractionInstance for FSFileAbstractionInstance { FSFileAbstractionInstance::File(ref mut f, _) => return { // We seek to the beginning of the file since we expect each // access to the file to be in a different context - try!(f.seek(SeekFrom::Start(0)) - .chain_err(|| SEK::FileNotCreated)); + f.seek(SeekFrom::Start(0)) + .chain_err(|| SEK::FileNotCreated)?; - try!(f.set_len(buf.len() as u64).chain_err(|| SEK::FileNotWritten)); + f.set_len(buf.len() as u64).chain_err(|| SEK::FileNotWritten)?; f.write_all(&buf).chain_err(|| SEK::FileNotWritten) }, FSFileAbstractionInstance::Absent(ref p) => - (try!(create_file(p).chain_err(|| SEK::FileNotCreated)), p.clone()), + (create_file(p).chain_err(|| SEK::FileNotCreated)?, p.clone()), }; *self = FSFileAbstractionInstance::File(file, path); if let FSFileAbstractionInstance::File(ref mut f, _) = *self { @@ -129,7 +129,7 @@ impl FileAbstraction for FSFileAbstraction { match to.parent() { Some(p) => if !p.exists() { debug!("Creating: {:?}", p); - let _ = try!(create_dir_all(&PathBuf::from(p))); + let _ = create_dir_all(&PathBuf::from(p))?; }, None => { debug!("Failed to find parent. This looks like it will fail now"); @@ -184,11 +184,11 @@ impl FileAbstraction for FSFileAbstraction { }) .fold(Ok(vec![]), |acc, e| { acc.and_then(move |mut a| { - a.push(try!(e)); + a.push(e?); Ok(a) }) }); - Ok(PathIterator::new(Box::new(try!(i).into_iter()))) + Ok(PathIterator::new(Box::new(i?.into_iter()))) } } diff --git a/lib/core/libimagstore/src/file_abstraction/inmemory.rs b/lib/core/libimagstore/src/file_abstraction/inmemory.rs index 9a9adf67..094a5af0 100644 --- a/lib/core/libimagstore/src/file_abstraction/inmemory.rs +++ b/lib/core/libimagstore/src/file_abstraction/inmemory.rs @@ -131,7 +131,7 @@ impl FileAbstraction for InMemoryFileAbstraction { let mut mtx = self.backend().lock().expect("Locking Mutex failed"); let backend = mtx.get_mut(); - let a = try!(backend.get(from).cloned().ok_or(SE::from_kind(SEK::FileNotFound))); + let a = backend.get(from).cloned().ok_or(SE::from_kind(SEK::FileNotFound))?; backend.insert(to.clone(), a); debug!("Copying: {:?} -> {:?} worked", from, to); Ok(()) @@ -142,7 +142,7 @@ impl FileAbstraction for InMemoryFileAbstraction { let mut mtx = self.backend().lock().expect("Locking Mutex failed"); let backend = mtx.get_mut(); - let a = try!(backend.get(from).cloned().ok_or(SE::from_kind(SEK::FileNotFound))); + let a = backend.get(from).cloned().ok_or(SE::from_kind(SEK::FileNotFound))?; backend.insert(to.clone(), a); debug!("Renaming: {:?} -> {:?} worked", from, to); Ok(()) @@ -176,7 +176,7 @@ impl FileAbstraction for InMemoryFileAbstraction { fn fill<'a>(&'a mut self, mut d: Drain) -> Result<(), SE> { debug!("Draining into : {:?}", self); - let mut mtx = try!(self.backend().lock().map_err(|_| SEK::LockError)); + let mut mtx = self.backend().lock().map_err(|_| SEK::LockError)?; let backend = mtx.get_mut(); for (path, element) in d.iter() { diff --git a/lib/core/libimagstore/src/file_abstraction/stdio/mapper/json.rs b/lib/core/libimagstore/src/file_abstraction/stdio/mapper/json.rs index 3bd46d6c..7bc8fc9d 100644 --- a/lib/core/libimagstore/src/file_abstraction/stdio/mapper/json.rs +++ b/lib/core/libimagstore/src/file_abstraction/stdio/mapper/json.rs @@ -73,15 +73,15 @@ impl Mapper for JsonMapper { let mut document = { debug!("Reading Document"); let mut s = String::new(); - try!(r.read_to_string(&mut s).chain_err(|| SEK::IoError)); + r.read_to_string(&mut s).chain_err(|| SEK::IoError)?; debug!("Document = {:?}", s); debug!("Parsing Document"); - let doc : Document = try!(serde_json::from_str(&s).chain_err(|| SEK::IoError)); + let doc : Document = serde_json::from_str(&s).chain_err(|| SEK::IoError)?; debug!("Document = {:?}", doc); doc }; - let _ = try!(::semver::Version::parse(&document.version) + let _ = ::semver::Version::parse(&document.version) .chain_err(|| SEK::VersionError) .and_then(|doc_vers| { // safe because cargo does not compile if crate version is not valid @@ -96,7 +96,7 @@ impl Mapper for JsonMapper { } else { Ok(()) } - })); + })?; for (key, val) in document.store.drain() { debug!("(key, value) ({:?}, {:?})", key, val); @@ -110,7 +110,7 @@ impl Mapper for JsonMapper { }) .map(|_| ()); - let _ = try!(res); + let _ = res?; } Ok(()) diff --git a/lib/core/libimagstore/src/file_abstraction/stdio/mod.rs b/lib/core/libimagstore/src/file_abstraction/stdio/mod.rs index 7bf4f425..5b93f6f0 100644 --- a/lib/core/libimagstore/src/file_abstraction/stdio/mod.rs +++ b/lib/core/libimagstore/src/file_abstraction/stdio/mod.rs @@ -56,11 +56,10 @@ impl StdIoFileAbstraction pub fn new(in_stream: &mut R, out_stream: Rc>, mapper: M) -> Result, SE> { StdoutFileAbstraction::new(out_stream, mapper) .and_then(|out| { - let _ = try!(out - .backend() - .lock() - .map_err(|_| SE::from_kind(SEK::LockError)) - .map(|mut mtx| out.mapper().read_to_fs(in_stream, mtx.get_mut()))); + let _ = out.backend() + .lock() + .map_err(|_| SE::from_kind(SEK::LockError)) + .map(|mut mtx| out.mapper().read_to_fs(in_stream, mtx.get_mut()))?; Ok(StdIoFileAbstraction(out)) }) diff --git a/lib/core/libimagstore/src/file_abstraction/stdio/out.rs b/lib/core/libimagstore/src/file_abstraction/stdio/out.rs index c8540b33..5f62e899 100644 --- a/lib/core/libimagstore/src/file_abstraction/stdio/out.rs +++ b/lib/core/libimagstore/src/file_abstraction/stdio/out.rs @@ -150,7 +150,7 @@ impl FileAbstraction for StdoutFileAbstraction { fn fill(&mut self, mut d: Drain) -> Result<(), SE> { debug!("Draining into : {:?}", self); - let mut mtx = try!(self.backend().lock().map_err(|_| SE::from_kind(SEK::IoError))); + let mut mtx = self.backend().lock().map_err(|_| SE::from_kind(SEK::IoError))?; let backend = mtx.get_mut(); for (path, element) in d.iter() { diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs index 21e42e4f..cdbebb50 100644 --- a/lib/core/libimagstore/src/store.rs +++ b/lib/core/libimagstore/src/store.rs @@ -140,13 +140,13 @@ impl Iterator for Walk { impl StoreEntry { fn new(id: StoreId, backend: &Box) -> Result { - let pb = try!(id.clone().into_pathbuf()); + let pb = id.clone().into_pathbuf()?; #[cfg(feature = "fs-lock")] { - try!(open_file(pb.clone()) + open_file(pb.clone()) .and_then(|f| f.lock_exclusive()) - .chain_err(|| SEK::IoError)); + .chain_err(|| SEK::IoError)?; } Ok(StoreEntry { @@ -258,7 +258,7 @@ impl Store { use configuration::*; debug!("Validating Store configuration"); - let _ = try!(config_is_valid(&store_config).chain_err(|| SEK::ConfigurationError)); + let _ = config_is_valid(&store_config).chain_err(|| SEK::ConfigurationError)?; debug!("Building new Store object"); if !location.exists() { @@ -268,9 +268,10 @@ impl Store { .chain_err(|| SEK::IoError); } - try!(backend.create_dir_all(&location) - .chain_err(|| SEK::StorePathCreate(location.clone())) - .map_dbg_err_str("Failed")); + backend + .create_dir_all(&location) + .chain_err(|| SEK::StorePathCreate(location.clone())) + .map_dbg_err_str("Failed")?; } else if location.is_file() { debug!("Store path exists as file"); return Err(SE::from_kind(SEK::StorePathExists(location))); @@ -391,7 +392,7 @@ impl Store { /// - CreateCallError(EntryAlreadyExists()) if the entry exists already. /// pub fn create<'a, S: IntoStoreId>(&'a self, id: S) -> Result> { - let id = try!(id.into_storeid()).with_base(self.path().clone()); + let id = id.into_storeid()?.with_base(self.path().clone()); debug!("Creating id: '{}'", id); @@ -408,7 +409,7 @@ impl Store { } hsmap.insert(id.clone(), { debug!("Creating: '{}'", id); - let mut se = try!(StoreEntry::new(id.clone(), &self.backend)); + let mut se = StoreEntry::new(id.clone(), &self.backend)?; se.status = StoreEntryStatus::Borrowed; se }); @@ -434,21 +435,20 @@ impl Store { /// - RetrieveCallError(LockPoisoned()) if the internal lock is poisened. /// pub fn retrieve<'a, S: IntoStoreId>(&'a self, id: S) -> Result> { - let id = try!(id.into_storeid()).with_base(self.path().clone()); + let id = id.into_storeid()?.with_base(self.path().clone()); debug!("Retrieving id: '{}'", id); - let entry = try!({ - self.entries - .write() - .map_err(|_| SE::from_kind(SEK::LockPoisoned)) - .and_then(|mut es| { - let new_se = try!(StoreEntry::new(id.clone(), &self.backend)); - let se = es.entry(id.clone()).or_insert(new_se); - let entry = se.get_entry(); - se.status = StoreEntryStatus::Borrowed; - entry - }) - .chain_err(|| SEK::RetrieveCallError) - }); + let entry = self + .entries + .write() + .map_err(|_| SE::from_kind(SEK::LockPoisoned)) + .and_then(|mut es| { + let new_se = StoreEntry::new(id.clone(), &self.backend)?; + let se = es.entry(id.clone()).or_insert(new_se); + let entry = se.get_entry(); + se.status = StoreEntryStatus::Borrowed; + entry + }) + .chain_err(|| SEK::RetrieveCallError)?; debug!("Constructing FileLockEntry: '{}'", id); Ok(FileLockEntry::new(self, entry)) @@ -465,16 +465,15 @@ impl Store { /// - Errors Store::retrieve() might return /// pub fn get<'a, S: IntoStoreId + Clone>(&'a self, id: S) -> Result>> { - let id = try!(id.into_storeid()).with_base(self.path().clone()); + let id = id.into_storeid()?.with_base(self.path().clone()); debug!("Getting id: '{}'", id); - let exists = try!(id.exists()) || try!(self.entries + let exists = id.exists()? || self.entries .read() .map(|map| map.contains_key(&id)) .map_err(|_| SE::from_kind(SEK::LockPoisoned)) - .chain_err(|| SEK::GetCallError) - ); + .chain_err(|| SEK::GetCallError)?; if !exists { debug!("Does not exist in internal cache or filesystem: {:?}", id); @@ -558,17 +557,17 @@ impl Store { Ok(e) => e, }; - let se = try!(hsmap.get_mut(&entry.location).ok_or_else(|| { + let se = hsmap.get_mut(&entry.location).ok_or_else(|| { SE::from_kind(SEK::IdNotFound(entry.location.clone())) - })); + })?; assert!(se.is_borrowed(), "Tried to update a non borrowed entry."); debug!("Verifying Entry"); - try!(entry.entry.verify()); + entry.entry.verify()?; debug!("Writing Entry"); - try!(se.write_entry(&entry.entry)); + se.write_entry(&entry.entry)?; if modify_presence { debug!("Modifying ppresence of {} -> Present", entry.get_location()); se.status = StoreEntryStatus::Present; @@ -590,7 +589,7 @@ impl Store { /// - Errors StoreEntry::new() might return /// pub fn retrieve_copy(&self, id: S) -> Result { - let id = try!(id.into_storeid()).with_base(self.path().clone()); + let id = id.into_storeid()?.with_base(self.path().clone()); debug!("Retrieving copy of '{}'", id); let entries = match self.entries.write() { Err(_) => { @@ -605,7 +604,7 @@ impl Store { return Err(SE::from_kind(SEK::IdLocked)).chain_err(|| SEK::RetrieveCopyCallError); } - try!(StoreEntry::new(id, &self.backend)).get_entry() + StoreEntry::new(id, &self.backend)?.get_entry() } /// Delete an entry @@ -620,7 +619,7 @@ impl Store { /// - DeleteCallError(FileError()) if the internals failed to remove the file. /// pub fn delete(&self, id: S) -> Result<()> { - let id = try!(id.into_storeid()).with_base(self.path().clone()); + let id = id.into_storeid()?.with_base(self.path().clone()); debug!("Deleting id: '{}'", id); @@ -641,7 +640,7 @@ impl Store { // StoreId::exists(), a PathBuf object gets allocated. So we simply get a // PathBuf here, check whether it is there and if it is, we can re-use it to // delete the filesystem file. - let pb = try!(id.into_pathbuf()); + let pb = id.into_pathbuf()?; if pb.exists() { // looks like we're deleting a not-loaded file from the store. @@ -660,7 +659,7 @@ impl Store { // remove the entry first, then the file entries.remove(&id); - let pb = try!(id.clone().with_base(self.path().clone()).into_pathbuf()); + let pb = id.clone().with_base(self.path().clone()).into_pathbuf()?; if let Err(e) = self.backend.remove_file(&pb) { return Err(e) .chain_err(|| SEK::FileError) @@ -689,12 +688,11 @@ impl Store { -> Result<()> { let new_id = new_id.with_base(self.path().clone()); - let hsmap = try!( - self.entries - .write() - .map_err(|_| SE::from_kind(SEK::LockPoisoned)) - .chain_err(|| SEK::MoveCallError) - ); + let hsmap = self + .entries + .write() + .map_err(|_| SE::from_kind(SEK::LockPoisoned)) + .chain_err(|| SEK::MoveCallError)?; if hsmap.contains_key(&new_id) { return Err(SE::from_kind(SEK::EntryAlreadyExists(new_id.clone()))) @@ -703,8 +701,8 @@ impl Store { let old_id = entry.get_location().clone(); - let old_id_as_path = try!(old_id.clone().with_base(self.path().clone()).into_pathbuf()); - let new_id_as_path = try!(new_id.clone().with_base(self.path().clone()).into_pathbuf()); + let old_id_as_path = old_id.clone().with_base(self.path().clone()).into_pathbuf()?; + let new_id_as_path = new_id.clone().with_base(self.path().clone()).into_pathbuf()?; self.backend.copy(&old_id_as_path, &new_id_as_path) .and_then(|_| { if remove_old { @@ -777,10 +775,10 @@ impl Store { debug!("Old id is not yet borrowed"); - let old_id_pb = try!(old_id.clone().with_base(self.path().clone()).into_pathbuf()); - let new_id_pb = try!(new_id.clone().with_base(self.path().clone()).into_pathbuf()); + let old_id_pb = old_id.clone().with_base(self.path().clone()).into_pathbuf()?; + let new_id_pb = new_id.clone().with_base(self.path().clone()).into_pathbuf()?; - if try!(self.backend.exists(&new_id_pb)) { + if self.backend.exists(&new_id_pb)? { return Err(SE::from_kind(SEK::EntryAlreadyExists(new_id.clone()))); } debug!("New entry does not yet exist on filesystem. Good."); @@ -817,11 +815,12 @@ impl Store { let is_file = { let mut base = self.path().clone(); base.push(element.clone()); - try!(self.backend.is_file(&base)) + println!("Checking: {:?}", base); + self.backend.is_file(&base)? }; if is_file { - let sid = try!(StoreId::from_full_path(self.path(), element)); + let sid = StoreId::from_full_path(self.path(), element)?; elems.push(sid); } } @@ -841,14 +840,14 @@ impl Debug for Store { /// TODO: Make pretty. fn fmt(&self, fmt: &mut Formatter) -> RResult<(), FMTError> { - try!(write!(fmt, " --- Store ---\n")); - try!(write!(fmt, "\n")); - try!(write!(fmt, " - location : {:?}\n", self.location)); - try!(write!(fmt, " - configuration : {:?}\n", self.configuration)); - try!(write!(fmt, "\n")); - try!(write!(fmt, "Entries:\n")); - try!(write!(fmt, "{:?}", self.entries)); - try!(write!(fmt, "\n")); + write!(fmt, " --- Store ---\n")?; + write!(fmt, "\n")?; + write!(fmt, " - location : {:?}\n", self.location)?; + write!(fmt, " - configuration : {:?}\n", self.configuration)?; + write!(fmt, "\n")?; + write!(fmt, "Entries:\n")?; + write!(fmt, "{:?}", self.entries)?; + write!(fmt, "\n")?; Ok(()) } @@ -979,7 +978,7 @@ impl Entry { pub fn from_reader(loc: S, file: &mut Read) -> Result { let text = { let mut s = String::new(); - try!(file.read_to_string(&mut s)); + file.read_to_string(&mut s)?; s }; Self::from_str(loc, &text[..]) @@ -1000,10 +999,10 @@ impl Entry { pub fn from_str(loc: S, s: &str) -> Result { use util::entry_buffer_to_header_content; - let (header, content) = try!(entry_buffer_to_header_content(s)); + let (header, content) = entry_buffer_to_header_content(s)?; Ok(Entry { - location: try!(loc.into_storeid()), + location: loc.into_storeid()?, header: header, content: content, }) diff --git a/lib/core/libimagstore/src/storeid.rs b/lib/core/libimagstore/src/storeid.rs index 94fa3433..dde25a2e 100644 --- a/lib/core/libimagstore/src/storeid.rs +++ b/lib/core/libimagstore/src/storeid.rs @@ -59,9 +59,9 @@ impl StoreId { pub fn from_full_path(store_part: &PathBuf, full_path: D) -> Result where D: Deref { - let p = try!( - full_path.strip_prefix(store_part).chain_err(|| SEK::StoreIdBuildFromFullPathError) - ); + let p = full_path + .strip_prefix(store_part) + .chain_err(|| SEK::StoreIdBuildFromFullPathError)?; StoreId::new(Some(store_part.clone()), PathBuf::from(p)) } @@ -91,7 +91,7 @@ impl StoreId { /// specified. pub fn into_pathbuf(mut self) -> Result { let base = self.base.take(); - let mut base = try!(base.ok_or_else(|| SEK::StoreIdHasNoBaseError(self.id.clone()))); + let mut base = base.ok_or_else(|| SEK::StoreIdHasNoBaseError(self.id.clone()))?; base.push(self.id); Ok(base) } diff --git a/lib/core/libimagstore/src/util.rs b/lib/core/libimagstore/src/util.rs index e77e8eb3..040881d2 100644 --- a/lib/core/libimagstore/src/util.rs +++ b/lib/core/libimagstore/src/util.rs @@ -64,6 +64,6 @@ pub fn entry_buffer_to_header_content(buf: &str) -> Result<(Value, String)> { let content = matches.name("content").map(|r| r.as_str()).unwrap_or(""); - Ok((try!(Value::parse(header.as_str())), String::from(content))) + Ok((Value::parse(header.as_str())?, String::from(content))) } From a20871eb5e13e754f06d25aa38f3628cfe51a6f2 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Oct 2017 16:35:57 +0200 Subject: [PATCH 04/25] Add badges in Cargo.toml of all crates --- bin/core/imag-annotate/Cargo.toml | 6 ++++++ bin/core/imag-gps/Cargo.toml | 6 ++++++ bin/core/imag-grep/Cargo.toml | 6 ++++++ bin/core/imag-link/Cargo.toml | 6 ++++++ bin/core/imag-mv/Cargo.toml | 6 ++++++ bin/core/imag-ref/Cargo.toml | 6 ++++++ bin/core/imag-store/Cargo.toml | 6 ++++++ bin/core/imag-tag/Cargo.toml | 6 ++++++ bin/core/imag-view/Cargo.toml | 6 ++++++ bin/core/imag/Cargo.toml | 6 ++++++ bin/domain/imag-bookmark/Cargo.toml | 6 ++++++ bin/domain/imag-diary/Cargo.toml | 6 ++++++ bin/domain/imag-mail/Cargo.toml | 6 ++++++ bin/domain/imag-notes/Cargo.toml | 6 ++++++ bin/domain/imag-timetrack/Cargo.toml | 6 ++++++ bin/domain/imag-todo/Cargo.toml | 6 ++++++ lib/core/libimagerror/Cargo.toml | 6 ++++++ lib/core/libimagrt/Cargo.toml | 6 ++++++ lib/core/libimagstore/Cargo.toml | 6 ++++++ lib/domain/libimagbookmark/Cargo.toml | 6 ++++++ lib/domain/libimagdiary/Cargo.toml | 6 ++++++ lib/domain/libimagmail/Cargo.toml | 6 ++++++ lib/domain/libimagnotes/Cargo.toml | 6 ++++++ lib/domain/libimagtimetrack/Cargo.toml | 6 ++++++ lib/domain/libimagtodo/Cargo.toml | 6 ++++++ lib/entry/libimagentryannotation/Cargo.toml | 6 ++++++ lib/entry/libimagentrycategory/Cargo.toml | 6 ++++++ lib/entry/libimagentrydatetime/Cargo.toml | 6 ++++++ lib/entry/libimagentryedit/Cargo.toml | 6 ++++++ lib/entry/libimagentryfilter/Cargo.toml | 6 ++++++ lib/entry/libimagentrygps/Cargo.toml | 6 ++++++ lib/entry/libimagentrylink/Cargo.toml | 6 ++++++ lib/entry/libimagentrylist/Cargo.toml | 6 ++++++ lib/entry/libimagentrymarkdown/Cargo.toml | 6 ++++++ lib/entry/libimagentryref/Cargo.toml | 6 ++++++ lib/entry/libimagentrytag/Cargo.toml | 6 ++++++ lib/entry/libimagentryview/Cargo.toml | 6 ++++++ lib/etc/libimaginteraction/Cargo.toml | 6 ++++++ lib/etc/libimagtimeui/Cargo.toml | 6 ++++++ lib/etc/libimagutil/Cargo.toml | 6 ++++++ 40 files changed, 240 insertions(+) diff --git a/bin/core/imag-annotate/Cargo.toml b/bin/core/imag-annotate/Cargo.toml index f76e8f1f..aabeffa0 100644 --- a/bin/core/imag-annotate/Cargo.toml +++ b/bin/core/imag-annotate/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/core/imag-gps/Cargo.toml b/bin/core/imag-gps/Cargo.toml index 3824e51d..1314f778 100644 --- a/bin/core/imag-gps/Cargo.toml +++ b/bin/core/imag-gps/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/core/imag-grep/Cargo.toml b/bin/core/imag-grep/Cargo.toml index f56ba328..4525cb70 100644 --- a/bin/core/imag-grep/Cargo.toml +++ b/bin/core/imag-grep/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" version = "2.0.1" diff --git a/bin/core/imag-link/Cargo.toml b/bin/core/imag-link/Cargo.toml index 12ab562a..68344aac 100644 --- a/bin/core/imag-link/Cargo.toml +++ b/bin/core/imag-link/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/core/imag-mv/Cargo.toml b/bin/core/imag-mv/Cargo.toml index d3eaf1d9..4eb2c984 100644 --- a/bin/core/imag-mv/Cargo.toml +++ b/bin/core/imag-mv/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] version = "2.0" clap = ">=2.17" diff --git a/bin/core/imag-ref/Cargo.toml b/bin/core/imag-ref/Cargo.toml index 1e19add7..3faf6117 100644 --- a/bin/core/imag-ref/Cargo.toml +++ b/bin/core/imag-ref/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/core/imag-store/Cargo.toml b/bin/core/imag-store/Cargo.toml index feee3a6f..ad3c207f 100644 --- a/bin/core/imag-store/Cargo.toml +++ b/bin/core/imag-store/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/core/imag-tag/Cargo.toml b/bin/core/imag-tag/Cargo.toml index 969bbcdd..0d8b7909 100644 --- a/bin/core/imag-tag/Cargo.toml +++ b/bin/core/imag-tag/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/core/imag-view/Cargo.toml b/bin/core/imag-view/Cargo.toml index 7a3bcff5..488f2f6d 100644 --- a/bin/core/imag-view/Cargo.toml +++ b/bin/core/imag-view/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/core/imag/Cargo.toml b/bin/core/imag/Cargo.toml index 9249beef..140cd12a 100644 --- a/bin/core/imag/Cargo.toml +++ b/bin/core/imag/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] version = "2.0" walkdir = "1" diff --git a/bin/domain/imag-bookmark/Cargo.toml b/bin/domain/imag-bookmark/Cargo.toml index 1f492021..13b6f738 100644 --- a/bin/domain/imag-bookmark/Cargo.toml +++ b/bin/domain/imag-bookmark/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/domain/imag-diary/Cargo.toml b/bin/domain/imag-diary/Cargo.toml index 606ca0b1..a1ad5a4d 100644 --- a/bin/domain/imag-diary/Cargo.toml +++ b/bin/domain/imag-diary/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] chrono = "0.4" version = "2.0" diff --git a/bin/domain/imag-mail/Cargo.toml b/bin/domain/imag-mail/Cargo.toml index f7583140..bc05582e 100644 --- a/bin/domain/imag-mail/Cargo.toml +++ b/bin/domain/imag-mail/Cargo.toml @@ -9,6 +9,12 @@ keywords = ["imag", "PIM", "personal", "information", "management"] readme = "../../../README.md" license = "LGPL-2.1" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/domain/imag-notes/Cargo.toml b/bin/domain/imag-notes/Cargo.toml index 246010b7..0e97826c 100644 --- a/bin/domain/imag-notes/Cargo.toml +++ b/bin/domain/imag-notes/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/domain/imag-timetrack/Cargo.toml b/bin/domain/imag-timetrack/Cargo.toml index c8ad0d75..52938e1d 100644 --- a/bin/domain/imag-timetrack/Cargo.toml +++ b/bin/domain/imag-timetrack/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/bin/domain/imag-todo/Cargo.toml b/bin/domain/imag-todo/Cargo.toml index bcf8bea0..994857ce 100644 --- a/bin/domain/imag-todo/Cargo.toml +++ b/bin/domain/imag-todo/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/lib/core/libimagerror/Cargo.toml b/lib/core/libimagerror/Cargo.toml index 8c26d68c..56300ea4 100644 --- a/lib/core/libimagerror/Cargo.toml +++ b/lib/core/libimagerror/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] log = "0.3" ansi_term = "0.10" diff --git a/lib/core/libimagrt/Cargo.toml b/lib/core/libimagrt/Cargo.toml index 867f358c..88c27d24 100644 --- a/lib/core/libimagrt/Cargo.toml +++ b/lib/core/libimagrt/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" env_logger = "0.4" diff --git a/lib/core/libimagstore/Cargo.toml b/lib/core/libimagstore/Cargo.toml index 0f664d35..0fce876d 100644 --- a/lib/core/libimagstore/Cargo.toml +++ b/lib/core/libimagstore/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] glob = "0.2.11" lazy_static = "0.2" diff --git a/lib/domain/libimagbookmark/Cargo.toml b/lib/domain/libimagbookmark/Cargo.toml index 2d00ec1e..7aa55f4e 100644 --- a/lib/domain/libimagbookmark/Cargo.toml +++ b/lib/domain/libimagbookmark/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] url = "1.5" regex = "0.2" diff --git a/lib/domain/libimagdiary/Cargo.toml b/lib/domain/libimagdiary/Cargo.toml index 16350ac4..c36184e6 100644 --- a/lib/domain/libimagdiary/Cargo.toml +++ b/lib/domain/libimagdiary/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] chrono = "0.4" log = "0.3" diff --git a/lib/domain/libimagmail/Cargo.toml b/lib/domain/libimagmail/Cargo.toml index f7f6fa37..145aa48d 100644 --- a/lib/domain/libimagmail/Cargo.toml +++ b/lib/domain/libimagmail/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] log = "0.3" email = "0.0.17" diff --git a/lib/domain/libimagnotes/Cargo.toml b/lib/domain/libimagnotes/Cargo.toml index b2fa6a1b..02a5a091 100644 --- a/lib/domain/libimagnotes/Cargo.toml +++ b/lib/domain/libimagnotes/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] log = "0.3" toml = "0.4" diff --git a/lib/domain/libimagtimetrack/Cargo.toml b/lib/domain/libimagtimetrack/Cargo.toml index 2c899369..73178cfc 100644 --- a/lib/domain/libimagtimetrack/Cargo.toml +++ b/lib/domain/libimagtimetrack/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] filters = "0.2" chrono = "0.4" diff --git a/lib/domain/libimagtodo/Cargo.toml b/lib/domain/libimagtodo/Cargo.toml index 88a4ca66..f53adaaa 100644 --- a/lib/domain/libimagtodo/Cargo.toml +++ b/lib/domain/libimagtodo/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] task-hookrs = "0.4" uuid = "0.5" diff --git a/lib/entry/libimagentryannotation/Cargo.toml b/lib/entry/libimagentryannotation/Cargo.toml index 430c5095..c3520772 100644 --- a/lib/entry/libimagentryannotation/Cargo.toml +++ b/lib/entry/libimagentryannotation/Cargo.toml @@ -9,6 +9,12 @@ keywords = ["imag", "PIM", "personal", "information", "management"] readme = "../../../README.md" license = "LGPL-2.1" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] lazy_static = "0.2" toml = "0.4" diff --git a/lib/entry/libimagentrycategory/Cargo.toml b/lib/entry/libimagentrycategory/Cargo.toml index 28882319..b8a96107 100644 --- a/lib/entry/libimagentrycategory/Cargo.toml +++ b/lib/entry/libimagentrycategory/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] log = "0.3" toml = "0.4" diff --git a/lib/entry/libimagentrydatetime/Cargo.toml b/lib/entry/libimagentrydatetime/Cargo.toml index 6309f929..38d83674 100644 --- a/lib/entry/libimagentrydatetime/Cargo.toml +++ b/lib/entry/libimagentrydatetime/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] chrono = "0.4" toml-query = "^0.4" diff --git a/lib/entry/libimagentryedit/Cargo.toml b/lib/entry/libimagentryedit/Cargo.toml index f038e5bd..0197b6cf 100644 --- a/lib/entry/libimagentryedit/Cargo.toml +++ b/lib/entry/libimagentryedit/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] error-chain = "0.11" diff --git a/lib/entry/libimagentryfilter/Cargo.toml b/lib/entry/libimagentryfilter/Cargo.toml index 1db247de..2f0ee40b 100644 --- a/lib/entry/libimagentryfilter/Cargo.toml +++ b/lib/entry/libimagentryfilter/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" filters = "0.2" diff --git a/lib/entry/libimagentrygps/Cargo.toml b/lib/entry/libimagentrygps/Cargo.toml index 5fd87a65..ab6aa88a 100644 --- a/lib/entry/libimagentrygps/Cargo.toml +++ b/lib/entry/libimagentrygps/Cargo.toml @@ -9,6 +9,12 @@ keywords = ["imag", "PIM", "personal", "information", "management"] readme = "../../../README.md" license = "LGPL-2.1" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] toml = "0.4" toml-query = "^0.4" diff --git a/lib/entry/libimagentrylink/Cargo.toml b/lib/entry/libimagentrylink/Cargo.toml index cf1f0860..c7981e5c 100644 --- a/lib/entry/libimagentrylink/Cargo.toml +++ b/lib/entry/libimagentrylink/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] itertools = "0.7" log = "0.3" diff --git a/lib/entry/libimagentrylist/Cargo.toml b/lib/entry/libimagentrylist/Cargo.toml index 88c0a32b..76d2b72c 100644 --- a/lib/entry/libimagentrylist/Cargo.toml +++ b/lib/entry/libimagentrylist/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/lib/entry/libimagentrymarkdown/Cargo.toml b/lib/entry/libimagentrymarkdown/Cargo.toml index 67153d66..c0f1443e 100644 --- a/lib/entry/libimagentrymarkdown/Cargo.toml +++ b/lib/entry/libimagentrymarkdown/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] log = "0.3" hoedown = "6.0.0" diff --git a/lib/entry/libimagentryref/Cargo.toml b/lib/entry/libimagentryref/Cargo.toml index abea8df6..c68167c5 100644 --- a/lib/entry/libimagentryref/Cargo.toml +++ b/lib/entry/libimagentryref/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] itertools = "0.7" log = "0.3" diff --git a/lib/entry/libimagentrytag/Cargo.toml b/lib/entry/libimagentrytag/Cargo.toml index 76194571..112f83ea 100644 --- a/lib/entry/libimagentrytag/Cargo.toml +++ b/lib/entry/libimagentrytag/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" log = "0.3" diff --git a/lib/entry/libimagentryview/Cargo.toml b/lib/entry/libimagentryview/Cargo.toml index 7c13c057..16fb5b14 100644 --- a/lib/entry/libimagentryview/Cargo.toml +++ b/lib/entry/libimagentryview/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] log = "0.3" toml = "0.4" diff --git a/lib/etc/libimaginteraction/Cargo.toml b/lib/etc/libimaginteraction/Cargo.toml index 0789629b..9dfc7f6c 100644 --- a/lib/etc/libimaginteraction/Cargo.toml +++ b/lib/etc/libimaginteraction/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] ansi_term = "0.10" clap = ">=2.17" diff --git a/lib/etc/libimagtimeui/Cargo.toml b/lib/etc/libimagtimeui/Cargo.toml index 8e461353..f92794f7 100644 --- a/lib/etc/libimagtimeui/Cargo.toml +++ b/lib/etc/libimagtimeui/Cargo.toml @@ -13,6 +13,12 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] clap = ">=2.17" lazy_static = "0.2" diff --git a/lib/etc/libimagutil/Cargo.toml b/lib/etc/libimagutil/Cargo.toml index be1b1afe..aca2ed1c 100644 --- a/lib/etc/libimagutil/Cargo.toml +++ b/lib/etc/libimagutil/Cargo.toml @@ -19,6 +19,12 @@ default = [] # Testing feature to compile testing utilities into the library. testing = [] +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + [dependencies] url = "1.5" boolinator = "2.4.0" From 131881cd018012c14dda6604e344f7b7c3c05ce4 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Oct 2017 16:17:35 +0200 Subject: [PATCH 05/25] Use ? operator instead of try!() macro --- lib/core/libimagrt/src/logger.rs | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/core/libimagrt/src/logger.rs b/lib/core/libimagrt/src/logger.rs index 60f50d6d..5b987ad7 100644 --- a/lib/core/libimagrt/src/logger.rs +++ b/lib/core/libimagrt/src/logger.rs @@ -85,30 +85,30 @@ impl ImagLogger { ::libimaginteraction::format::register_all_format_helpers(&mut handlebars); { - let fmt = try!(aggregate_global_format_trace(config)); - try!(handlebars.register_template_string("TRACE", fmt)); // name must be uppercase + let fmt = aggregate_global_format_trace(config)?; + handlebars.register_template_string("TRACE", fmt)?; // name must be uppercase } { - let fmt = try!(aggregate_global_format_debug(config)); - try!(handlebars.register_template_string("DEBUG", fmt)); // name must be uppercase + let fmt = aggregate_global_format_debug(config)?; + handlebars.register_template_string("DEBUG", fmt)?; // name must be uppercase } { - let fmt = try!(aggregate_global_format_info(config)); - try!(handlebars.register_template_string("INFO", fmt)); // name must be uppercase + let fmt = aggregate_global_format_info(config)?; + handlebars.register_template_string("INFO", fmt)?; // name must be uppercase } { - let fmt = try!(aggregate_global_format_warn(config)); - try!(handlebars.register_template_string("WARN", fmt)); // name must be uppercase + let fmt = aggregate_global_format_warn(config)?; + handlebars.register_template_string("WARN", fmt)?; // name must be uppercase } { - let fmt = try!(aggregate_global_format_error(config)); - try!(handlebars.register_template_string("ERROR", fmt)); // name must be uppercase + let fmt = aggregate_global_format_error(config)?; + handlebars.register_template_string("ERROR", fmt)?; // name must be uppercase } Ok(ImagLogger { - global_loglevel : try!(aggregate_global_loglevel(matches, config)), - global_destinations : try!(aggregate_global_destinations(matches, config)), - module_settings : try!(aggregate_module_settings(matches, config)), + global_loglevel : aggregate_global_loglevel(matches, config)?, + global_destinations : aggregate_global_destinations(matches, config)?, + module_settings : aggregate_module_settings(matches, config)?, handlebars : handlebars, }) } @@ -286,7 +286,7 @@ fn translate_destinations(raw: &Vec) -> Result> { .fold(Ok(vec![]), |acc, val| { acc.and_then(|mut v| { let dest = match *val { - Value::String(ref s) => try!(translate_destination(s)), + Value::String(ref s) => translate_destination(s)?, _ => { let path = "imag.logging.modules..destinations".to_owned(); let ty = "Array"; @@ -321,7 +321,7 @@ fn aggregate_global_destinations(matches: &ArgMatches, config: Option<&Value>) values.split(",") .fold(Ok(vec![]), move |acc, dest| { acc.and_then(|mut v| { - v.push(try!(translate_destination(dest))); + v.push(translate_destination(dest)?); Ok(v) }) }) @@ -393,7 +393,7 @@ fn aggregate_module_settings(_matches: &ArgMatches, config: Option<&Value>) let mut settings = BTreeMap::new(); for (module_name, v) in t { - let destinations = try!(match v.read("destinations") { + let destinations = match v.read("destinations") { Ok(Some(&Value::Array(ref a))) => translate_destinations(a).map(Some), Ok(None) => Ok(None), Ok(Some(_)) => { @@ -402,9 +402,9 @@ fn aggregate_module_settings(_matches: &ArgMatches, config: Option<&Value>) Err(RE::from_kind(EK::ConfigTypeError(path, ty))) }, Err(e) => Err(e).map_err(From::from), - }); + }?; - let level = try!(match v.read("level") { + let level = match v.read("level") { Ok(Some(&Value::String(ref s))) => match_log_level_str(s).map(Some), Ok(None) => Ok(None), Ok(Some(_)) => { @@ -413,9 +413,9 @@ fn aggregate_module_settings(_matches: &ArgMatches, config: Option<&Value>) Err(RE::from_kind(EK::ConfigTypeError(path, ty))) }, Err(e) => Err(e).map_err(From::from), - }); + }?; - let enabled = try!(match v.read("enabled") { + let enabled = match v.read("enabled") { Ok(Some(&Value::Boolean(b))) => Ok(b), Ok(None) => Ok(false), Ok(Some(_)) => { @@ -424,7 +424,7 @@ fn aggregate_module_settings(_matches: &ArgMatches, config: Option<&Value>) Err(RE::from_kind(EK::ConfigTypeError(path, ty))) }, Err(e) => Err(e).map_err(From::from), - }); + }?; let module_settings = ModuleSettings { enabled: enabled, From 82c30edceec25f3ffd6bbd5f975dfdf1ec336578 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Oct 2017 16:45:57 +0200 Subject: [PATCH 06/25] Simplify matching --- lib/core/libimagrt/src/logger.rs | 39 +++++++++++++++----------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/lib/core/libimagrt/src/logger.rs b/lib/core/libimagrt/src/logger.rs index 5b987ad7..5a4d80e6 100644 --- a/lib/core/libimagrt/src/logger.rs +++ b/lib/core/libimagrt/src/logger.rs @@ -393,38 +393,35 @@ fn aggregate_module_settings(_matches: &ArgMatches, config: Option<&Value>) let mut settings = BTreeMap::new(); for (module_name, v) in t { - let destinations = match v.read("destinations") { - Ok(Some(&Value::Array(ref a))) => translate_destinations(a).map(Some), - Ok(None) => Ok(None), - Ok(Some(_)) => { + let destinations = match v.read("destinations")? { + Some(&Value::Array(ref a)) => Some(translate_destinations(a)?), + None => None, + Some(_) => { let path = "imag.logging.modules..destinations".to_owned(); let ty = "Array"; - Err(RE::from_kind(EK::ConfigTypeError(path, ty))) + return Err(RE::from_kind(EK::ConfigTypeError(path, ty))) }, - Err(e) => Err(e).map_err(From::from), - }?; + }; - let level = match v.read("level") { - Ok(Some(&Value::String(ref s))) => match_log_level_str(s).map(Some), - Ok(None) => Ok(None), - Ok(Some(_)) => { + let level = match v.read("level")? { + Some(&Value::String(ref s)) => Some(match_log_level_str(s)?), + None => None, + Some(_) => { let path = "imag.logging.modules..level".to_owned(); let ty = "String"; - Err(RE::from_kind(EK::ConfigTypeError(path, ty))) + return Err(RE::from_kind(EK::ConfigTypeError(path, ty))) }, - Err(e) => Err(e).map_err(From::from), - }?; + }; - let enabled = match v.read("enabled") { - Ok(Some(&Value::Boolean(b))) => Ok(b), - Ok(None) => Ok(false), - Ok(Some(_)) => { + let enabled = match v.read("enabled")? { + Some(&Value::Boolean(b)) => b, + None => false, + Some(_) => { let path = "imag.logging.modules..enabled".to_owned(); let ty = "Boolean"; - Err(RE::from_kind(EK::ConfigTypeError(path, ty))) + return Err(RE::from_kind(EK::ConfigTypeError(path, ty))) }, - Err(e) => Err(e).map_err(From::from), - }?; + }; let module_settings = ModuleSettings { enabled: enabled, From 26d7fd4eb7b906c13d41b798d572fc31fc960891 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Oct 2017 16:17:35 +0200 Subject: [PATCH 07/25] Use ? operator instead of try!() macro --- lib/etc/libimagutil/src/edit.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/etc/libimagutil/src/edit.rs b/lib/etc/libimagutil/src/edit.rs index 5d1838fc..bab3c8e5 100644 --- a/lib/etc/libimagutil/src/edit.rs +++ b/lib/etc/libimagutil/src/edit.rs @@ -27,11 +27,11 @@ use std::io::Error as IOError; use tempfile::NamedTempFile; pub fn edit_in_tmpfile_with_command(mut cmd: Command, s: &mut String) -> Result { - let mut file = &try!(NamedTempFile::new()); + let mut file = &NamedTempFile::new()?; let file_path = file.path(); - try!(file.write_all(&s.clone().into_bytes()[..])); - try!(file.sync_data()); + file.write_all(&s.clone().into_bytes()[..])?; + file.sync_data()?; cmd.arg(file_path) .status() From d4031758d663e6552a7e8682c1a264e399c185f0 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Oct 2017 16:17:35 +0200 Subject: [PATCH 08/25] Use ? operator instead of try!() macro --- lib/etc/libimaginteraction/src/format.rs | 34 +++++++++---------- lib/etc/libimaginteraction/src/readline.rs | 38 +++++++++++----------- lib/etc/libimaginteraction/src/ui.rs | 6 ++-- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/lib/etc/libimaginteraction/src/format.rs b/lib/etc/libimaginteraction/src/format.rs index 409c072e..e39f92cb 100644 --- a/lib/etc/libimaginteraction/src/format.rs +++ b/lib/etc/libimaginteraction/src/format.rs @@ -95,9 +95,9 @@ impl HelperDef for ColorizeYellowHelper { } fn colorize(color: Colour, h: &Helper, _: &Handlebars, rc: &mut RenderContext) -> Result<(), RenderError> { - let p = try!(h.param(0).ok_or(RenderError::new("Too few arguments"))); + let p = h.param(0).ok_or(RenderError::new("Too few arguments"))?; - try!(write!(rc.writer(), "{}", color.paint(p.value().render()))); + write!(rc.writer(), "{}", color.paint(p.value().render()))?; Ok(()) } @@ -107,9 +107,9 @@ pub struct UnderlineHelper; impl HelperDef for UnderlineHelper { fn call(&self, h: &Helper, _: &Handlebars, rc: &mut RenderContext) -> Result<(), RenderError> { - let p = try!(h.param(0).ok_or(RenderError::new("Too few arguments"))); + let p = h.param(0).ok_or(RenderError::new("Too few arguments"))?; let s = Style::new().underline(); - try!(write!(rc.writer(), "{}", s.paint(p.value().render()))); + write!(rc.writer(), "{}", s.paint(p.value().render()))?; Ok(()) } } @@ -120,9 +120,9 @@ pub struct BoldHelper; impl HelperDef for BoldHelper { fn call(&self, h: &Helper, _: &Handlebars, rc: &mut RenderContext) -> Result<(), RenderError> { - let p = try!(h.param(0).ok_or(RenderError::new("Too few arguments"))); + let p = h.param(0).ok_or(RenderError::new("Too few arguments"))?; let s = Style::new().bold(); - try!(write!(rc.writer(), "{}", s.paint(p.value().render()))); + write!(rc.writer(), "{}", s.paint(p.value().render()))?; Ok(()) } } @@ -133,9 +133,9 @@ pub struct BlinkHelper; impl HelperDef for BlinkHelper { fn call(&self, h: &Helper, _: &Handlebars, rc: &mut RenderContext) -> Result<(), RenderError> { - let p = try!(h.param(0).ok_or(RenderError::new("Too few arguments"))); + let p = h.param(0).ok_or(RenderError::new("Too few arguments"))?; let s = Style::new().blink(); - try!(write!(rc.writer(), "{}", s.paint(p.value().render()))); + write!(rc.writer(), "{}", s.paint(p.value().render()))?; Ok(()) } } @@ -146,15 +146,15 @@ pub struct StrikethroughHelper; impl HelperDef for StrikethroughHelper { fn call(&self, h: &Helper, _: &Handlebars, rc: &mut RenderContext) -> Result<(), RenderError> { - let p = try!(h.param(0).ok_or(RenderError::new("Too few arguments"))); + let p = h.param(0).ok_or(RenderError::new("Too few arguments"))?; let s = Style::new().strikethrough(); - try!(write!(rc.writer(), "{}", s.paint(p.value().render()))); + write!(rc.writer(), "{}", s.paint(p.value().render()))?; Ok(()) } } fn param_to_number(idx: usize, h: &Helper) -> Result { - match try!(h.param(idx).ok_or(RenderError::new("Too few arguments"))).value() { + match h.param(idx).ok_or(RenderError::new("Too few arguments"))?.value() { &Value::Number(ref num) => num.as_u64().ok_or_else(|| RenderError::new("Number cannot be parsed")), _ => Err(RenderError::new("Type error: First argument should be a number")), } @@ -166,9 +166,9 @@ pub struct LeftPadHelper; impl HelperDef for LeftPadHelper { fn call(&self, h: &Helper, _: &Handlebars, rc: &mut RenderContext) -> Result<(), RenderError> { let count = param_to_number(0, h)? as usize; - let text = try!(h.param(1).ok_or(RenderError::new("Too few arguments"))); + let text = h.param(1).ok_or(RenderError::new("Too few arguments"))?; let text = format!("{:>width$}", text.value().render(), width = count); - try!(write!(rc.writer(), "{}", text)); + write!(rc.writer(), "{}", text)?; Ok(()) } } @@ -179,9 +179,9 @@ pub struct RightPadHelper; impl HelperDef for RightPadHelper { fn call(&self, h: &Helper, _: &Handlebars, rc: &mut RenderContext) -> Result<(), RenderError> { let count = param_to_number(0, h)? as usize; - let text = try!(h.param(1).ok_or(RenderError::new("Too few arguments"))); + let text = h.param(1).ok_or(RenderError::new("Too few arguments"))?; let text = format!("{:width$}", text.value().render(), width = count); - try!(write!(rc.writer(), "{}", text)); + write!(rc.writer(), "{}", text)?; Ok(()) } } @@ -192,8 +192,8 @@ pub struct AbbrevHelper; impl HelperDef for AbbrevHelper { fn call(&self, h: &Helper, _: &Handlebars, rc: &mut RenderContext) -> Result<(), RenderError> { let count = param_to_number(0, h)? as usize; - let text = try!(h.param(1).ok_or(RenderError::new("Too few arguments"))).value().render(); - try!(write!(rc.writer(), "{}", text.chars().take(count).collect::())); + let text = h.param(1).ok_or(RenderError::new("Too few arguments"))?.value().render(); + write!(rc.writer(), "{}", text.chars().take(count).collect::())?; Ok(()) } } diff --git a/lib/etc/libimaginteraction/src/readline.rs b/lib/etc/libimaginteraction/src/readline.rs index 3f9a6399..86aa51a9 100644 --- a/lib/etc/libimaginteraction/src/readline.rs +++ b/lib/etc/libimaginteraction/src/readline.rs @@ -34,48 +34,48 @@ pub struct Readline { impl Readline { pub fn new(rt: &Runtime) -> Result { - let c = try!(rt.config().ok_or(IEK::NoConfigError)); + let c = rt.config().ok_or(IEK::NoConfigError)?; - let histfile = try!(c.lookup("ui.cli.readline_history_file").ok_or(IEK::ConfigError)); - let histsize = try!(c.lookup("ui.cli.readline_history_size").ok_or(IEK::ConfigError)); - let histigndups = try!(c.lookup("ui.cli.readline_history_ignore_dups").ok_or(IEK::ConfigError)); - let histignspace = try!(c.lookup("ui.cli.readline_history_ignore_space").ok_or(IEK::ConfigError)); - let prompt = try!(c.lookup("ui.cli.readline_prompt").ok_or(IEK::ConfigError)); + let histfile = c.lookup("ui.cli.readline_history_file").ok_or(IEK::ConfigError)?; + let histsize = c.lookup("ui.cli.readline_history_size").ok_or(IEK::ConfigError)?; + let histigndups = c.lookup("ui.cli.readline_history_ignore_dups").ok_or(IEK::ConfigError)?; + let histignspace = c.lookup("ui.cli.readline_history_ignore_space").ok_or(IEK::ConfigError)?; + let prompt = c.lookup("ui.cli.readline_prompt").ok_or(IEK::ConfigError)?; - let histfile = try!(match histfile { + let histfile = match histfile { Value::String(s) => PathBuf::from(s), _ => Err(IE::from_kind(IEK::ConfigTypeError)) .chain_err(|| IEK::ConfigError) .chain_err(|| IEK::ReadlineError) - }); + }?; - let histsize = try!(match histsize { + let histsize = match histsize { Value::Integer(i) => i, _ => Err(IE::from_kind(IEK::ConfigTypeError)) .chain_err(|| IEK::ConfigError) .chain_err(|| IEK::ReadlineError) - }); + }?; - let histigndups = try!(match histigndups { + let histigndups = match histigndups { Value::Boolean(b) => b, _ => Err(IE::from_kind(IEK::ConfigTypeError)) .chain_err(|| IEK::ConfigError) .chain_err(|| IEK::ReadlineError) - }); + }?; - let histignspace = try!(match histignspace { + let histignspace = match histignspace { Value::Boolean(b) => b, _ => Err(IE::from_kind(IEK::ConfigTypeError)) .chain_err(|| IEK::ConfigError) .chain_err(|| IEK::ReadlineError) - }); + }?; - let prompt = try!(match prompt { + let prompt = match prompt { Value::String(s) => s, _ => Err(IE::from_kind(IEK::ConfigTypeError)) .chain_err(|| IEK::ConfigError) .chain_err(|| IEK::ReadlineError) - }); + }?; let config = Config::builder(). .max_history_size(histsize) @@ -86,11 +86,11 @@ impl Readline { let mut editor = Editor::new(config); if !histfile.exists() { - let _ = try!(File::create(histfile.clone()) - .chain_err(|| IEK::ReadlineHistoryFileCreationError)); + let _ = File::create(histfile.clone()) + .chain_err(|| IEK::ReadlineHistoryFileCreationError)?; } - let _ = try!(editor.load_history(&histfile).chain_err(|| ReadlineError)); + let _ = editor.load_history(&histfile).chain_err(|| ReadlineError)?; Ok(Readline { editor: editor, diff --git a/lib/etc/libimaginteraction/src/ui.rs b/lib/etc/libimaginteraction/src/ui.rs index d1712f94..9c16a2a5 100644 --- a/lib/etc/libimaginteraction/src/ui.rs +++ b/lib/etc/libimaginteraction/src/ui.rs @@ -59,7 +59,7 @@ pub fn get_id(matches: &ArgMatches) -> Result> { .fold(Ok(vec![]), |acc, elem| { acc.and_then(|mut v| { let elem = StoreId::new_baseless(PathBuf::from(String::from(elem))); - let elem = try!(elem.chain_err(|| IEK::StoreIdParsingError)); + let elem = elem.chain_err(|| IEK::StoreIdParsingError)?; v.push(elem); Ok(v) }) @@ -74,8 +74,8 @@ pub fn get_or_select_id(matches: &ArgMatches, store_path: &PathBuf) -> Result Ok(v), Err(_) => { let path = store_path.clone(); - let p = try!(pick_file(default_menu_cmd, path).chain_err(|| IEK::IdSelectingError)); - let id = try!(StoreId::new_baseless(p).chain_err(|| IEK::StoreIdParsingError)); + let p = pick_file(default_menu_cmd, path).chain_err(|| IEK::IdSelectingError)?; + let id = StoreId::new_baseless(p).chain_err(|| IEK::StoreIdParsingError)?; Ok(vec![id]) }, } From 85ccc482d2c846c3d6eb8e5b8caa2e8ec385177e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:17:21 +0100 Subject: [PATCH 09/25] Replace uses of try!() macro with "?" operator --- lib/entry/libimagentryannotation/src/annotateable.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/entry/libimagentryannotation/src/annotateable.rs b/lib/entry/libimagentryannotation/src/annotateable.rs index 356e66c0..ffd40879 100644 --- a/lib/entry/libimagentryannotation/src/annotateable.rs +++ b/lib/entry/libimagentryannotation/src/annotateable.rs @@ -48,13 +48,13 @@ impl Annotateable for Entry { /// Annotate an entry, returns the new entry which is used to annotate fn annotate<'a>(&mut self, store: &'a Store, ann_name: &str) -> Result> { use module_path::ModuleEntryPath; - store.retrieve(try!(ModuleEntryPath::new(ann_name).into_storeid())) + store.retrieve(ModuleEntryPath::new(ann_name).into_storeid()?) .map_err(From::from) .and_then(|mut anno| { { let header = anno.get_header_mut(); - try!(header.insert("annotation.is_annotation", Value::Boolean(true))); - try!(header.insert("annotation.name", Value::String(String::from(ann_name)))); + header.insert("annotation.is_annotation", Value::Boolean(true))?; + header.insert("annotation.name", Value::String(String::from(ann_name)))?; } Ok(anno) }) @@ -69,7 +69,7 @@ impl Annotateable for Entry { /// `ann_name`, which is then returned fn denotate<'a>(&mut self, store: &'a Store, ann_name: &str) -> Result>> { for annotation in self.annotations(store)? { - let mut anno = try!(annotation); + let mut anno = annotation?; let name = match anno.get_header().read("annotation.name")? { None => continue, Some(val) => match *val { @@ -79,7 +79,7 @@ impl Annotateable for Entry { }; if name == ann_name { - let _ = try!(self.remove_internal_link(&mut anno)); + let _ = self.remove_internal_link(&mut anno)?; return Ok(Some(anno)); } } From 51a7429283d6a06fc8266c425f684acf84ba83aa Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:17:21 +0100 Subject: [PATCH 10/25] Replace uses of try!() macro with "?" operator --- lib/entry/libimagentrycategory/src/register.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/entry/libimagentrycategory/src/register.rs b/lib/entry/libimagentrycategory/src/register.rs index 67cb6877..af23d5bf 100644 --- a/lib/entry/libimagentrycategory/src/register.rs +++ b/lib/entry/libimagentrycategory/src/register.rs @@ -57,7 +57,7 @@ impl CategoryRegister for Store { /// Check whether a category exists fn category_exists(&self, name: &str) -> Result { - let sid = try!(mk_category_storeid(self.path().clone(), name)); + let sid = mk_category_storeid(self.path().clone(), name)?; represents_category(self, sid, name) } @@ -67,7 +67,7 @@ impl CategoryRegister for Store { fn create_category(&self, name: &str) -> Result { use libimagstore::error::StoreErrorKind as SEK; - let sid = try!(mk_category_storeid(self.path().clone(), name)); + let sid = mk_category_storeid(self.path().clone(), name)?; match self.create(sid) { @@ -94,7 +94,7 @@ impl CategoryRegister for Store { /// Delete a category fn delete_category(&self, name: &str) -> Result<()> { - let sid = try!(mk_category_storeid(self.path().clone(), name)); + let sid = mk_category_storeid(self.path().clone(), name)?; self.delete(sid).chain_err(|| CEK::StoreWriteError) } @@ -111,7 +111,7 @@ impl CategoryRegister for Store { /// Returns the FileLockEntry which represents the category, so one can link to it and use it /// like a normal file in the store (which is exactly what it is). fn get_category_by_name(&self, name: &str) -> Result> { - let sid = try!(mk_category_storeid(self.path().clone(), name)); + let sid = mk_category_storeid(self.path().clone(), name)?; self.get(sid) .chain_err(|| CEK::StoreWriteError) From 14bacaf01f6fb900cbab18c2663869b41ebc9162 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:17:21 +0100 Subject: [PATCH 11/25] Replace uses of try!() macro with "?" operator --- .../libimagentrydatetime/src/datetime.rs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/entry/libimagentrydatetime/src/datetime.rs b/lib/entry/libimagentrydatetime/src/datetime.rs index 420f65f0..692f1d53 100644 --- a/lib/entry/libimagentrydatetime/src/datetime.rs +++ b/lib/entry/libimagentrydatetime/src/datetime.rs @@ -112,11 +112,11 @@ impl EntryDate for Entry { /// header in an inconsistent state. /// fn delete_date_range(&mut self) -> Result<()> { - let _ = try!(self + let _ = self .get_header_mut() .delete(&DATE_RANGE_START_HEADER_LOCATION) .map(|_| ()) - .chain_err(|| DEK::DeleteDateTimeRangeError)); + .chain_err(|| DEK::DeleteDateTimeRangeError)?; self.get_header_mut() .delete(&DATE_RANGE_END_HEADER_LOCATION) @@ -125,7 +125,7 @@ impl EntryDate for Entry { } fn read_date_range(&self) -> Result { - let start = try!(self + let start = self .get_header() .read(&DATE_RANGE_START_HEADER_LOCATION) .chain_err(|| DEK::ReadDateTimeRangeError) @@ -136,9 +136,9 @@ impl EntryDate for Entry { Some(_) => Err(DE::from_kind(DEK::DateHeaderFieldTypeError)), _ => Err(DE::from_kind(DEK::ReadDateError)), } - })); + })?; - let end = try!(self + let end = self .get_header() .read(&DATE_RANGE_START_HEADER_LOCATION) .chain_err(|| DEK::ReadDateTimeRangeError) @@ -149,7 +149,7 @@ impl EntryDate for Entry { Some(_) => Err(DE::from_kind(DEK::DateHeaderFieldTypeError)), _ => Err(DE::from_kind(DEK::ReadDateError)), } - })); + })?; DateTimeRange::new(start, end) .chain_err(|| DEK::DateTimeRangeError) @@ -168,7 +168,7 @@ impl EntryDate for Entry { let start = start.format(&DATE_FMT).to_string(); let end = end.format(&DATE_FMT).to_string(); - let opt_old_start = try!(self + let opt_old_start = self .get_header_mut() .insert(&DATE_RANGE_START_HEADER_LOCATION, Value::String(start)) .map(|opt| opt.map(|stri| { @@ -178,9 +178,9 @@ impl EntryDate for Entry { _ => Err(DE::from_kind(DEK::DateHeaderFieldTypeError)), } })) - .chain_err(|| DEK::SetDateTimeRangeError)); + .chain_err(|| DEK::SetDateTimeRangeError)?; - let opt_old_end = try!(self + let opt_old_end = self .get_header_mut() .insert(&DATE_RANGE_END_HEADER_LOCATION, Value::String(end)) .map(|opt| opt.map(|stri| { @@ -190,7 +190,7 @@ impl EntryDate for Entry { _ => Err(DE::from_kind(DEK::DateHeaderFieldTypeError)), } })) - .chain_err(|| DEK::SetDateTimeRangeError)); + .chain_err(|| DEK::SetDateTimeRangeError)?; match (opt_old_start, opt_old_end) { (Some(Ok(old_start)), Some(Ok(old_end))) => { From ec3daa1f41dfb9902225adf7bcc2ffd61bbade89 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:17:21 +0100 Subject: [PATCH 12/25] Replace uses of try!() macro with "?" operator --- lib/entry/libimagentrygps/src/entry.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/entry/libimagentrygps/src/entry.rs b/lib/entry/libimagentrygps/src/entry.rs index 1e54157e..3383e25d 100644 --- a/lib/entry/libimagentrygps/src/entry.rs +++ b/lib/entry/libimagentrygps/src/entry.rs @@ -89,7 +89,7 @@ impl GPSEntry for Entry { let mut hdr = self.get_header_mut(); for pattern in patterns.iter() { - let _ = try!(hdr.delete(pattern).chain_err(|| GPSEK::HeaderWriteError)); + let _ = hdr.delete(pattern).chain_err(|| GPSEK::HeaderWriteError)?; } match coordinates { From da391954ccbc6f1a6f82c30a1b9d5e62a63a4a0a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:17:21 +0100 Subject: [PATCH 13/25] Replace uses of try!() macro with "?" operator --- lib/entry/libimagentrylink/src/external.rs | 14 ++++----- lib/entry/libimagentrylink/src/internal.rs | 34 +++++++++++----------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/entry/libimagentrylink/src/external.rs b/lib/entry/libimagentrylink/src/external.rs index 1211da3d..c3eccfa6 100644 --- a/lib/entry/libimagentrylink/src/external.rs +++ b/lib/entry/libimagentrylink/src/external.rs @@ -325,12 +325,12 @@ impl ExternalLinker for Entry { s.input_str(&link.as_str()[..]); s.result_str() }; - let file_id = try!( + let file_id = ModuleEntryPath::new(format!("external/{}", hash)).into_storeid() .map_dbg_err(|_| { format!("Failed to build StoreId for this hash '{:?}'", hash) }) - ); + ?; debug!("Link = '{:?}'", link); debug!("Hash = '{:?}'", hash); @@ -338,17 +338,17 @@ impl ExternalLinker for Entry { // retrieve the file from the store, which implicitely creates the entry if it does not // exist - let mut file = try!(store + let mut file = store .retrieve(file_id.clone()) .map_dbg_err(|_| { format!("Failed to create or retrieve an file for this link '{:?}'", link) - })); + })?; debug!("Generating header content!"); { let hdr = file.deref_mut().get_header_mut(); - let mut table = match try!(hdr.read("links.external.content")) { + let mut table = match hdr.read("links.external.content")? { Some(&Value::Table(ref table)) => table.clone(), Some(_) => { warn!("There is a value at 'links.external.content' which is not a table."); @@ -363,12 +363,12 @@ impl ExternalLinker for Entry { debug!("setting URL = '{:?}", v); table.insert(String::from("url"), v); - let _ = try!(hdr.insert("links.external.content", Value::Table(table))); + let _ = hdr.insert("links.external.content", Value::Table(table))?; debug!("Setting URL worked"); } // then add an internal link to the new file or return an error if this fails - let _ = try!(self.add_internal_link(file.deref_mut())); + let _ = self.add_internal_link(file.deref_mut())?; debug!("Error adding internal link"); } debug!("Ready iterating"); diff --git a/lib/entry/libimagentrylink/src/internal.rs b/lib/entry/libimagentrylink/src/internal.rs index 5b531969..1598feb9 100644 --- a/lib/entry/libimagentrylink/src/internal.rs +++ b/lib/entry/libimagentrylink/src/internal.rs @@ -406,7 +406,7 @@ impl InternalLinker for Entry { new_links.push(link.get_location().clone().into()); } - let new_links = try!(LinkIter::new(new_links) + let new_links = LinkIter::new(new_links) .into_values() .into_iter() .fold(Ok(vec![]), |acc, elem| { @@ -417,7 +417,7 @@ impl InternalLinker for Entry { v }) }) - })); + })?; let res = self .get_header_mut() .insert("links.internal", Value::Array(new_links)) @@ -477,7 +477,7 @@ fn add_internal_link_with_instance(this: &mut Entry, link: &mut Entry, instance: } fn rewrite_links>(header: &mut Value, links: I) -> Result<()> { - let links = try!(links.into_values() + let links = links.into_values() .into_iter() .fold(Ok(vec![]), |acc, elem| { acc.and_then(move |mut v| { @@ -487,7 +487,7 @@ fn rewrite_links>(header: &mut Value, links: I) -> Resu v }) }) - })); + })?; debug!("Setting new link array: {:?}", links); let process = header @@ -502,7 +502,7 @@ fn add_foreign_link(target: &mut Entry, from: StoreId) -> Result<()> { debug!("Linking back from {:?} to {:?}", target.get_location(), from); target.get_internal_links() .and_then(|links| { - let links = try!(links + let links = links .chain(LinkIter::new(vec![from.into()])) .into_values() .into_iter() @@ -514,7 +514,7 @@ fn add_foreign_link(target: &mut Entry, from: StoreId) -> Result<()> { v }) }) - })); + })?; debug!("Setting links in {:?}: {:?}", target.get_location(), links); let res = target @@ -551,7 +551,7 @@ fn process_rw_result(links: Result>) -> Result { return Err(LEK::ExistingLinkTypeWrong.into()); } - let links : Vec = try!(links.into_iter() + let links : Vec = links.into_iter() .map(|link| { debug!("Matching the link: {:?}", link); match link { @@ -566,11 +566,11 @@ fn process_rw_result(links: Result>) -> Result { debug!("Things missing... returning Error instance"); Err(LE::from_kind(LEK::LinkParserError)) } else { - let link = try!(tab.remove("link") - .ok_or(LE::from_kind(LEK::LinkParserFieldMissingError))); + let link = tab.remove("link") + .ok_or(LE::from_kind(LEK::LinkParserFieldMissingError))?; - let anno = try!(tab.remove("annotation") - .ok_or(LE::from_kind(LEK::LinkParserFieldMissingError))); + let anno = tab.remove("annotation") + .ok_or(LE::from_kind(LEK::LinkParserFieldMissingError))?; debug!("Ok, here we go with building a Link::Annotated"); match (link, anno) { @@ -591,7 +591,7 @@ fn process_rw_result(links: Result>) -> Result { _ => unreachable!(), } }) - .collect()); + .collect::>>()?; debug!("Ok, the RW action was successful, returning link vector now!"); Ok(LinkIter::new(links)) @@ -641,7 +641,7 @@ pub mod store_check { let mut map = HashMap::new(); for element in iter { debug!("Checking element = {:?}", element); - let entry = match try!(element) { + let entry = match element? { Some(e) => e, None => { let e = String::from("TODO: Not yet handled"); @@ -659,7 +659,7 @@ pub mod store_check { for internal_link in internal_links { debug!("internal link = {:?}", internal_link); - linking.outgoing.push(try!(internal_link).get_location().clone()); + linking.outgoing.push(internal_link?.get_location().clone()); linking.incoming.push(entry.get_location().clone()); } @@ -677,7 +677,7 @@ pub mod store_check { if is_match!(self.get(id.clone()), Ok(Some(_))) { debug!("Exists in store: {:?}", id); - if !try!(id.exists()) { + if !id.exists()? { warn!("Does exist in store but not on FS: {:?}", id); return Err(LE::from_kind(LEK::LinkTargetDoesNotExist)) } @@ -750,8 +750,8 @@ pub mod store_check { }) .and_then(|nw| { for (id, linking) in nw.iter() { - try!(incoming_links_exists_as_outgoing_links(id, linking, &nw)); - try!(outgoing_links_exist_as_incoming_links(id, linking, &nw)); + incoming_links_exists_as_outgoing_links(id, linking, &nw)?; + outgoing_links_exist_as_incoming_links(id, linking, &nw)?; } Ok(()) }) From d60f7d72e6229bb5ed0005923f30923d66f2f2a0 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:17:21 +0100 Subject: [PATCH 14/25] Replace uses of try!() macro with "?" operator --- lib/entry/libimagentrylist/src/listers/line.rs | 2 +- lib/entry/libimagentrylist/src/listers/path.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/entry/libimagentrylist/src/listers/line.rs b/lib/entry/libimagentrylist/src/listers/line.rs index b4c2639b..8f89e66e 100644 --- a/lib/entry/libimagentrylist/src/listers/line.rs +++ b/lib/entry/libimagentrylist/src/listers/line.rs @@ -47,7 +47,7 @@ impl<'a> Lister for LineLister<'a> { for entry in entries { let s = entry.get_location().to_str().unwrap_or(String::from(self.unknown_output)); - try!(write!(stdout(), "{:?}\n", s).chain_err(|| LEK::FormatError)) + write!(stdout(), "{:?}\n", s).chain_err(|| LEK::FormatError)? } Ok(()) diff --git a/lib/entry/libimagentrylist/src/listers/path.rs b/lib/entry/libimagentrylist/src/listers/path.rs index f45239d6..b88d43fa 100644 --- a/lib/entry/libimagentrylist/src/listers/path.rs +++ b/lib/entry/libimagentrylist/src/listers/path.rs @@ -47,14 +47,14 @@ impl Lister for PathLister { for entry in entries { let pb = entry.get_location().clone(); - let pb = try!(pb.into_pathbuf().chain_err(|| LEK::FormatError)); + let pb = pb.into_pathbuf().chain_err(|| LEK::FormatError)?; let pb = if self.absolute { - try!(pb.canonicalize().chain_err(|| LEK::FormatError)) + pb.canonicalize().chain_err(|| LEK::FormatError)? } else { pb.into() }; - try!(write!(stdout(), "{:?}\n", pb).chain_err(|| LEK::FormatError)) + write!(stdout(), "{:?}\n", pb).chain_err(|| LEK::FormatError)? } Ok(()) From 81ceb50f4a06f58f152499e32bbd770d70c1b2be Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:17:21 +0100 Subject: [PATCH 15/25] Replace uses of try!() macro with "?" operator --- lib/entry/libimagentrymarkdown/src/processor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/entry/libimagentrymarkdown/src/processor.rs b/lib/entry/libimagentrymarkdown/src/processor.rs index f0036497..943990a0 100644 --- a/lib/entry/libimagentrymarkdown/src/processor.rs +++ b/lib/entry/libimagentrymarkdown/src/processor.rs @@ -116,7 +116,7 @@ impl LinkProcessor { let spath = Some(store.path().clone()); let id = StoreId::new(spath, PathBuf::from(&link.link))?; let mut target = if self.create_internal_targets { - try!(store.retrieve(id)) + store.retrieve(id)? } else { store.get(id.clone())? .ok_or(ME::from_kind(MEK::StoreGetError(id)))? @@ -144,7 +144,7 @@ impl LinkProcessor { trace!("URL.host_str() = {:?}", url.host_str()); let path = url.host_str().unwrap_or_else(|| url.path()); let path = PathBuf::from(path); - let mut target = try!(RefStore::create(store, path, flags)); + let mut target = RefStore::create(store, path, flags)?; entry.add_internal_link(&mut target)?; }, From 078936191b5e39ba576d3ab2a742c0a85958d60e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:17:22 +0100 Subject: [PATCH 16/25] Replace uses of try!() macro with "?" operator --- lib/entry/libimagentryref/src/flags.rs | 4 ++-- lib/entry/libimagentryref/src/hasher.rs | 2 +- .../libimagentryref/src/hashers/nbytes.rs | 4 ++-- lib/entry/libimagentryref/src/lister.rs | 2 +- lib/entry/libimagentryref/src/reference.rs | 16 ++++++------- lib/entry/libimagentryref/src/refstore.rs | 23 ++++++++----------- 6 files changed, 24 insertions(+), 27 deletions(-) diff --git a/lib/entry/libimagentryref/src/flags.rs b/lib/entry/libimagentryref/src/flags.rs index a15a97ce..2d87c7c0 100644 --- a/lib/entry/libimagentryref/src/flags.rs +++ b/lib/entry/libimagentryref/src/flags.rs @@ -49,8 +49,8 @@ impl RefFlags { } Ok(RefFlags { - content_hashing: try!(get_field(v, "ref.flags.content_hashing")), - permission_tracking: try!(get_field(v, "ref.flags.permission_tracking")), + content_hashing: get_field(v, "ref.flags.content_hashing")?, + permission_tracking: get_field(v, "ref.flags.permission_tracking")?, }) } diff --git a/lib/entry/libimagentryref/src/hasher.rs b/lib/entry/libimagentryref/src/hasher.rs index d50c08ce..79088c2b 100644 --- a/lib/entry/libimagentryref/src/hasher.rs +++ b/lib/entry/libimagentryref/src/hasher.rs @@ -55,7 +55,7 @@ impl Hasher for DefaultHasher { fn create_hash(&mut self, _: &PathBuf, c: &mut R) -> Result { let mut s = String::new(); - try!(c.read_to_string(&mut s)); + c.read_to_string(&mut s)?; self.hasher.input_str(&s[..]); Ok(self.hasher.result_str()) } diff --git a/lib/entry/libimagentryref/src/hashers/nbytes.rs b/lib/entry/libimagentryref/src/hashers/nbytes.rs index de2e311e..dd910042 100644 --- a/lib/entry/libimagentryref/src/hashers/nbytes.rs +++ b/lib/entry/libimagentryref/src/hashers/nbytes.rs @@ -51,12 +51,12 @@ impl Hasher for NBytesHasher { } fn create_hash(&mut self, _: &PathBuf, contents: &mut R) -> Result { - let s : String = try!(contents + let s : String = contents .bytes() .take(self.n) .collect::, _>>() .map_err(From::from) - .and_then(|v| String::from_utf8(v).map_err(RE::from))); + .and_then(|v| String::from_utf8(v).map_err(RE::from))?; self.hasher.input_str(&s[..]); Ok(self.hasher.result_str()) diff --git a/lib/entry/libimagentryref/src/lister.rs b/lib/entry/libimagentryref/src/lister.rs index 0cf4d5bc..e3d9bdfa 100644 --- a/lib/entry/libimagentryref/src/lister.rs +++ b/lib/entry/libimagentryref/src/lister.rs @@ -89,7 +89,7 @@ impl Lister for RefLister { debug!("Listing Entry: {:?}", entry); { let is_dead = if self.check_dead { - if try!(lerror::ResultExt::chain_err(entry.fs_link_exists(), || LEK::FormatError)) { + if lerror::ResultExt::chain_err(entry.fs_link_exists(), || LEK::FormatError)? { "dead" } else { "alive" diff --git a/lib/entry/libimagentryref/src/reference.rs b/lib/entry/libimagentryref/src/reference.rs index 3643dab0..c043b1e0 100644 --- a/lib/entry/libimagentryref/src/reference.rs +++ b/lib/entry/libimagentryref/src/reference.rs @@ -219,8 +219,8 @@ impl Ref for Entry { /// Check whether the Hashsum of the referenced file is equal to the stored hashsum fn fs_link_valid_hash(&self) -> Result { - let stored_hash = try!(self.get_stored_hash()); - let current_hash = try!(self.get_current_hash()); + let stored_hash = self.get_stored_hash()?; + let current_hash = self.get_current_hash()?; Ok(stored_hash == current_hash) } @@ -233,18 +233,18 @@ impl Ref for Entry { /// Update the Ref by re-checking the file from FS using the passed Hasher instance /// This errors if the file is not present or cannot be read() fn update_ref_with_hasher(&mut self, h: &H) -> Result<()> { - let current_hash = try!(self.get_current_hash()); // uses the default hasher - let current_perm = try!(self.get_current_permissions()); + let current_hash = self.get_current_hash()?; // uses the default hasher + let current_perm = self.get_current_permissions()?; - try!(self + self .get_header_mut() .set("ref.permissions.ro", Value::Boolean(current_perm.readonly())) - ); + ?; - try!(self + self .get_header_mut() .set(&format!("ref.content_hash.{}", h.hash_name())[..], Value::String(current_hash)) - ); + ?; Ok(()) } diff --git a/lib/entry/libimagentryref/src/refstore.rs b/lib/entry/libimagentryref/src/refstore.rs index 102d3d94..8a7413b4 100644 --- a/lib/entry/libimagentryref/src/refstore.rs +++ b/lib/entry/libimagentryref/src/refstore.rs @@ -91,10 +91,10 @@ impl RefStore for Store { // manually here. If you can come up with a better version of this, feel free to // take this note as a todo. for r in possible_refs { - let contains_hash = try!(r.to_str() + let contains_hash = r.to_str() .chain_err(|| REK::TypeConversionError) .map(|s| s.contains(&hash[..])) - ); + ?; if !contains_hash { continue; @@ -182,14 +182,14 @@ impl RefStore for Store { } let (mut fle, content_hash, permissions, canonical_path) = { // scope to be able to fold - try!(File::open(pb.clone()) + File::open(pb.clone()) .chain_err(|| REK::RefTargetFileCannotBeOpened) // If we were able to open this file, // we hash the contents of the file and return (file, hash) .and_then(|mut file| { let opt_contenthash = if flags.get_content_hashing() { - Some(try!(h.create_hash(&pb, &mut file))) + Some(h.create_hash(&pb, &mut file)?) } else { None }; @@ -201,11 +201,9 @@ impl RefStore for Store { // and return (file, content hash, permissions) .and_then(|(file, opt_contenthash)| { let opt_permissions = if flags.get_permission_tracking() { - Some(try!(file - .metadata() - .map(|md| md.permissions()) - .chain_err(|| REK::RefTargetCannotReadPermissions) - )) + Some(file.metadata() + .map(|md| md.permissions()) + .chain_err(|| REK::RefTargetCannotReadPermissions)?) } else { None }; @@ -226,7 +224,7 @@ impl RefStore for Store { // and then we hash the canonicalized path // and return (file, content hash, permissions, canonicalized path, path hash) .and_then(|(opt_contenthash, opt_permissions, can)| { - let path_hash = try!(hash_path(&can).chain_err(|| REK::PathHashingError)); + let path_hash = hash_path(&can).chain_err(|| REK::PathHashingError)?; Ok((opt_contenthash, opt_permissions, can, path_hash)) }) @@ -246,10 +244,9 @@ impl RefStore for Store { // and then we create the FileLockEntry in the Store // and return (filelockentry, content hash, permissions, canonicalized path) .and_then(|(opt_conhash, opt_perm, can, path_hash)| { - let fle = try!(self.create(ModuleEntryPath::new(path_hash))); + let fle = self.create(ModuleEntryPath::new(path_hash))?; Ok((fle, opt_conhash, opt_perm, can)) - }) - ) + })? }; for tpl in [ From d5f537dc4dee45903bd868d9df593c30082b9530 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:17:22 +0100 Subject: [PATCH 17/25] Replace uses of try!() macro with "?" operator --- lib/entry/libimagentrytag/src/tagable.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/entry/libimagentrytag/src/tagable.rs b/lib/entry/libimagentrytag/src/tagable.rs index 7b9687a2..601bc900 100644 --- a/lib/entry/libimagentrytag/src/tagable.rs +++ b/lib/entry/libimagentrytag/src/tagable.rs @@ -49,7 +49,7 @@ pub trait Tagable { impl Tagable for Value { fn get_tags(&self) -> Result> { - let tags = try!(self.read("tag.values").chain_err(|| TagErrorKind::HeaderReadError)); + let tags = self.read("tag.values").chain_err(|| TagErrorKind::HeaderReadError)?; match tags { Some(&Value::Array(ref tags)) => { @@ -92,7 +92,7 @@ impl Tagable for Value { } fn add_tag(&mut self, t: Tag) -> Result<()> { - if !try!(is_tag_str(&t).map(|_| true).map_err(|_| TE::from_kind(TagErrorKind::NotATag))) { + if !is_tag_str(&t).map(|_| true).map_err(|_| TE::from_kind(TagErrorKind::NotATag))? { debug!("Not a tag: '{}'", t); return Err(TagErrorKind::NotATag.into()); } @@ -107,7 +107,7 @@ impl Tagable for Value { } fn remove_tag(&mut self, t: Tag) -> Result<()> { - if !try!(is_tag_str(&t).map(|_| true).map_err(|_| TE::from_kind(TagErrorKind::NotATag))) { + if !is_tag_str(&t).map(|_| true).map_err(|_| TE::from_kind(TagErrorKind::NotATag))? { debug!("Not a tag: '{}'", t); return Err(TagErrorKind::NotATag.into()); } @@ -121,7 +121,7 @@ impl Tagable for Value { } fn has_tag(&self, t: TagSlice) -> Result { - let tags = try!(self.read("tag.values").chain_err(|| TagErrorKind::HeaderReadError)); + let tags = self.read("tag.values").chain_err(|| TagErrorKind::HeaderReadError)?; if !tags.iter().all(|t| is_match!(*t, &Value::String(_))) { return Err(TagErrorKind::TagTypeError.into()); @@ -140,7 +140,7 @@ impl Tagable for Value { fn has_tags(&self, tags: &[Tag]) -> Result { let mut result = true; for tag in tags { - result = result && try!(self.has_tag(tag)); + result = result && self.has_tag(tag)?; } Ok(result) From ee7b04dd42ff8c497d0b046b93f4162d0df951a1 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:19:29 +0100 Subject: [PATCH 18/25] Replace uses of try!() macro with "?" operator --- bin/core/imag/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/core/imag/src/main.rs b/bin/core/imag/src/main.rs index 0b75574d..0047f25a 100644 --- a/bin/core/imag/src/main.rs +++ b/bin/core/imag/src/main.rs @@ -254,12 +254,12 @@ fn main() { } fn fetch_aliases(rt: &Runtime) -> Result, String> { - let cfg = try!(rt.config().ok_or_else(|| String::from("No configuration found"))); + let cfg = rt.config().ok_or_else(|| String::from("No configuration found"))?; let value = cfg .read("imag.aliases") .map_err(|_| String::from("Reading from config failed")); - match try!(value) { + match value? { None => Ok(BTreeMap::new()), Some(&Value::Table(ref tbl)) => { let mut alias_mappings = BTreeMap::new(); From 246bf04dbf9887ae803ca0f32e30c6952418702e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:19:29 +0100 Subject: [PATCH 19/25] Replace uses of try!() macro with "?" operator --- bin/core/imag-store/src/retrieve.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/core/imag-store/src/retrieve.rs b/bin/core/imag-store/src/retrieve.rs index 5c664f93..905fe98d 100644 --- a/bin/core/imag-store/src/retrieve.rs +++ b/bin/core/imag-store/src/retrieve.rs @@ -35,7 +35,7 @@ pub fn retrieve(rt: &Runtime) { let id = scmd.value_of("id").unwrap(); let path = PathBuf::from(id); let store = Some(rt.store().path().clone()); - let path = try!(StoreId::new(store, path).map_err_trace_exit(1)); + let path = StoreId::new(store, path).map_err_trace_exit(1)?; debug!("path = {:?}", path); rt.store() From 1dda98e17ee355d11c5fa7ec4420acd6f270ff88 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:19:29 +0100 Subject: [PATCH 20/25] Replace uses of try!() macro with "?" operator --- bin/domain/imag-bookmark/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/domain/imag-bookmark/src/main.rs b/bin/domain/imag-bookmark/src/main.rs index 7f2131ce..3529b0ef 100644 --- a/bin/domain/imag-bookmark/src/main.rs +++ b/bin/domain/imag-bookmark/src/main.rs @@ -88,7 +88,7 @@ fn add(rt: &Runtime) { BookmarkCollection::get(rt.store(), &coll) .and_then(|mut collection| { for url in scmd.values_of("urls").unwrap() { // unwrap saved by clap - let _ = try!(collection.add_link(BookmarkLink::from(url))); + let _ = collection.add_link(BookmarkLink::from(url))?; } Ok(()) }) From 9308c05057bf73578f27021c9038870f2bc4eaca Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:19:29 +0100 Subject: [PATCH 21/25] Replace uses of try!() macro with "?" operator --- bin/domain/imag-timetrack/src/day.rs | 6 +++--- bin/domain/imag-timetrack/src/list.rs | 6 +++--- bin/domain/imag-timetrack/src/month.rs | 6 +++--- bin/domain/imag-timetrack/src/week.rs | 6 +++--- bin/domain/imag-timetrack/src/year.rs | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bin/domain/imag-timetrack/src/day.rs b/bin/domain/imag-timetrack/src/day.rs index bd76867d..29251221 100644 --- a/bin/domain/imag-timetrack/src/day.rs +++ b/bin/domain/imag-timetrack/src/day.rs @@ -88,13 +88,13 @@ pub fn day(rt: &Runtime) -> i32 { acc.and_then(|_| { debug!("Processing {:?}", e.get_location()); - let tag = try!(e.get_timetrack_tag()); + let tag = e.get_timetrack_tag()?; debug!(" -> tag = {:?}", tag); - let start = try!(e.get_start_datetime()); + let start = e.get_start_datetime()?; debug!(" -> start = {:?}", start); - let end = try!(e.get_end_datetime()); + let end = e.get_end_datetime()?; debug!(" -> end = {:?}", end); match (start, end) { diff --git a/bin/domain/imag-timetrack/src/list.rs b/bin/domain/imag-timetrack/src/list.rs index 25c0ce0c..109a7ae6 100644 --- a/bin/domain/imag-timetrack/src/list.rs +++ b/bin/domain/imag-timetrack/src/list.rs @@ -91,13 +91,13 @@ pub fn list(rt: &Runtime) -> i32 { acc.and_then(|_| { debug!("Processing {:?}", e.get_location()); - let tag = try!(e.get_timetrack_tag()); + let tag = e.get_timetrack_tag()?; debug!(" -> tag = {:?}", tag); - let start = try!(e.get_start_datetime()); + let start = e.get_start_datetime()?; debug!(" -> start = {:?}", start); - let end = try!(e.get_end_datetime()); + let end = e.get_end_datetime()?; debug!(" -> end = {:?}", end); match (start, end) { diff --git a/bin/domain/imag-timetrack/src/month.rs b/bin/domain/imag-timetrack/src/month.rs index 80ddd8f2..144b1091 100644 --- a/bin/domain/imag-timetrack/src/month.rs +++ b/bin/domain/imag-timetrack/src/month.rs @@ -103,13 +103,13 @@ pub fn month(rt: &Runtime) -> i32 { acc.and_then(|_| { debug!("Processing {:?}", e.get_location()); - let tag = try!(e.get_timetrack_tag()); + let tag = e.get_timetrack_tag()?; debug!(" -> tag = {:?}", tag); - let start = try!(e.get_start_datetime()); + let start = e.get_start_datetime()?; debug!(" -> start = {:?}", start); - let end = try!(e.get_end_datetime()); + let end = e.get_end_datetime()?; debug!(" -> end = {:?}", end); match (start, end) { diff --git a/bin/domain/imag-timetrack/src/week.rs b/bin/domain/imag-timetrack/src/week.rs index 39acdf13..1043989b 100644 --- a/bin/domain/imag-timetrack/src/week.rs +++ b/bin/domain/imag-timetrack/src/week.rs @@ -95,13 +95,13 @@ pub fn week(rt: &Runtime) -> i32 { acc.and_then(|_| { debug!("Processing {:?}", e.get_location()); - let tag = try!(e.get_timetrack_tag()); + let tag = e.get_timetrack_tag()?; debug!(" -> tag = {:?}", tag); - let start = try!(e.get_start_datetime()); + let start = e.get_start_datetime()?; debug!(" -> start = {:?}", start); - let end = try!(e.get_end_datetime()); + let end = e.get_end_datetime()?; debug!(" -> end = {:?}", end); match (start, end) { diff --git a/bin/domain/imag-timetrack/src/year.rs b/bin/domain/imag-timetrack/src/year.rs index 11b01974..a5ce27fe 100644 --- a/bin/domain/imag-timetrack/src/year.rs +++ b/bin/domain/imag-timetrack/src/year.rs @@ -94,13 +94,13 @@ pub fn year(rt: &Runtime) -> i32 { acc.and_then(|_| { debug!("Processing {:?}", e.get_location()); - let tag = try!(e.get_timetrack_tag()); + let tag = e.get_timetrack_tag()?; debug!(" -> tag = {:?}", tag); - let start = try!(e.get_start_datetime()); + let start = e.get_start_datetime()?; debug!(" -> start = {:?}", start); - let end = try!(e.get_end_datetime()); + let end = e.get_end_datetime()?; debug!(" -> end = {:?}", end); match (start, end) { From e758a28c9e76977651874d106d0ad7ffbabc3474 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:19:29 +0100 Subject: [PATCH 22/25] Replace uses of try!() macro with "?" operator --- lib/domain/libimagdiary/src/diaryid.rs | 12 ++++++------ lib/domain/libimagdiary/src/viewer.rs | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/domain/libimagdiary/src/diaryid.rs b/lib/domain/libimagdiary/src/diaryid.rs index 0d47002e..43aab1c5 100644 --- a/lib/domain/libimagdiary/src/diaryid.rs +++ b/lib/domain/libimagdiary/src/diaryid.rs @@ -209,7 +209,7 @@ impl FromStoreId for DiaryId { let mut cmps = s.components().rev(); - let (hour, minute) = try!(next_component(&mut cmps).and_then(|time| { + let (hour, minute) = next_component(&mut cmps).and_then(|time| { let mut time = time.split(":"); let hour = time.next().and_then(|s| FromStr::from_str(s).ok()); let minute = time.next() @@ -223,7 +223,7 @@ impl FromStoreId for DiaryId { (Some(h), Some(m)) => Ok((h, m)), _ => return Err(DE::from_kind(DEK::IdParseError)), } - })); + })?; let day: Result = next_component(&mut cmps) .and_then(|s| s.parse::() @@ -244,10 +244,10 @@ impl FromStoreId for DiaryId { debug!("Year = {:?}", year); debug!("Name = {:?}", name); - let day = try!(day); - let month = try!(month); - let year = try!(year); - let name = try!(name); + let day = day?; + let month = month?; + let year = year?; + let name = name?; Ok(DiaryId::new(name, year, month, day, hour, minute)) } diff --git a/lib/domain/libimagdiary/src/viewer.rs b/lib/domain/libimagdiary/src/viewer.rs index b37061b1..cf37b8e7 100644 --- a/lib/domain/libimagdiary/src/viewer.rs +++ b/lib/domain/libimagdiary/src/viewer.rs @@ -54,10 +54,10 @@ impl DiaryViewer { Ok(id) => println!("{} :\n", id), Err(e) => trace_error(&e), } - let _ = try!(self.0 + let _ = self.0 .view_entry(&entry) .chain_err(|| DEK::ViewError) - .chain_err(|| DEK::IOError)); + .chain_err(|| DEK::IOError)?; println!("\n---\n"); } From a44d79093c61c4b88bdd4a99ffb5d238b73fd3c5 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:19:29 +0100 Subject: [PATCH 23/25] Replace uses of try!() macro with "?" operator --- lib/domain/libimagmail/src/hasher.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/domain/libimagmail/src/hasher.rs b/lib/domain/libimagmail/src/hasher.rs index 3d3ff702..79e8deb6 100644 --- a/lib/domain/libimagmail/src/hasher.rs +++ b/lib/domain/libimagmail/src/hasher.rs @@ -51,7 +51,7 @@ impl Hasher for MailHasher { use email::Header; let mut s = String::new(); - try!(c.read_to_string(&mut s)); + c.read_to_string(&mut s)?; MimeMessage::parse(&s) .chain_err(|| REK::RefHashingError) @@ -66,9 +66,9 @@ impl Hasher for MailHasher { let mut v : Vec = vec![]; for hdr in mail.headers.iter().filter(|item| filter.filter(item)) { - let s = try!(hdr + let s = hdr .get_value() - .chain_err(|| REK::RefHashingError)); + .chain_err(|| REK::RefHashingError)?; v.push(s); } From 29c9ad71b55879aad57e502c8e00e187af82faea Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:19:29 +0100 Subject: [PATCH 24/25] Replace uses of try!() macro with "?" operator --- lib/domain/libimagnotes/src/notestore.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/domain/libimagnotes/src/notestore.rs b/lib/domain/libimagnotes/src/notestore.rs index b16de614..0547b68a 100644 --- a/lib/domain/libimagnotes/src/notestore.rs +++ b/lib/domain/libimagnotes/src/notestore.rs @@ -49,10 +49,10 @@ impl<'a> NoteStore<'a> for Store { debug!("Creating new Note: '{}'", name); let fle = { - let mut lockentry = try!(ModuleEntryPath::new(name.clone()) + let mut lockentry = ModuleEntryPath::new(name.clone()) .into_storeid() .and_then(|id| self.create(id)) - .chain_err(|| NEK::StoreWriteError)); + .chain_err(|| NEK::StoreWriteError)?; { let entry = lockentry.deref_mut(); From f82ad2b6d1db3dbc84e1af4a2a4dabf23e31b1cc Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:19:29 +0100 Subject: [PATCH 25/25] Replace uses of try!() macro with "?" operator --- lib/domain/libimagtodo/src/taskstore.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/domain/libimagtodo/src/taskstore.rs b/lib/domain/libimagtodo/src/taskstore.rs index 0b9cca03..9febe2e1 100644 --- a/lib/domain/libimagtodo/src/taskstore.rs +++ b/lib/domain/libimagtodo/src/taskstore.rs @@ -54,7 +54,7 @@ impl<'a> TaskStore<'a> for Store { fn import_task_from_reader(&'a self, mut r: R) -> Result<(FileLockEntry<'a>, String, Uuid)> { let mut line = String::new(); - try!(r.read_line(&mut line).map_err(|_| TE::from_kind(TEK::UTF8Error))); + r.read_line(&mut line).map_err(|_| TE::from_kind(TEK::UTF8Error))?; import_task(&line.as_str()) .map_err(|_| TE::from_kind(TEK::ImportError)) .and_then(|t| { @@ -74,7 +74,7 @@ impl<'a> TaskStore<'a> for Store { /// fn get_task_from_import(&'a self, mut r: R) -> Result, String>> { let mut line = String::new(); - try!(r.read_line(&mut line).chain_err(|| TEK::UTF8Error)); + r.read_line(&mut line).chain_err(|| TEK::UTF8Error)?; self.get_task_from_string(line) } @@ -107,7 +107,7 @@ impl<'a> TaskStore<'a> for Store { /// implicitely create the task if it does not exist. fn retrieve_task_from_import(&'a self, mut r: R) -> Result> { let mut line = String::new(); - try!(r.read_line(&mut line).chain_err(|| TEK::UTF8Error)); + r.read_line(&mut line).chain_err(|| TEK::UTF8Error)?; self.retrieve_task_from_string(line) } @@ -186,14 +186,14 @@ impl<'a> TaskStore<'a> for Store { .and_then(|mut fle| { { let hdr = fle.get_header_mut(); - if try!(hdr.read("todo").chain_err(|| TEK::StoreError)).is_none() { - try!(hdr + if hdr.read("todo").chain_err(|| TEK::StoreError)?.is_none() { + hdr .set("todo", Value::Table(BTreeMap::new())) - .chain_err(|| TEK::StoreError)); + .chain_err(|| TEK::StoreError)?; } - try!(hdr.set("todo.uuid", Value::String(format!("{}",uuid))) - .chain_err(|| TEK::StoreError)); + hdr.set("todo.uuid", Value::String(format!("{}",uuid))) + .chain_err(|| TEK::StoreError)?; } // If none of the errors above have returned the function, everything is fine