summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-10-31 15:47:43 +0100
committerGitHub <noreply@github.com>2017-10-31 15:47:43 +0100
commit2d94be583180e4f8025e2aa1d2120b2ba925c41c (patch)
tree78515adccdc10cce12fec023dd5b3ff535d97d24
parent429194b5d05cc8bca93e1c33ab2c374b33a9ca40 (diff)
parentf82ad2b6d1db3dbc84e1af4a2a4dabf23e31b1cc (diff)
downloadimag-2d94be583180e4f8025e2aa1d2120b2ba925c41c.zip
imag-2d94be583180e4f8025e2aa1d2120b2ba925c41c.tar.gz
Merge pull request #1144 from matthiasbeyer/minor
Minor
-rw-r--r--README.md2
-rw-r--r--bin/core/imag-annotate/Cargo.toml6
-rw-r--r--bin/core/imag-gps/Cargo.toml6
-rw-r--r--bin/core/imag-grep/Cargo.toml6
-rw-r--r--bin/core/imag-link/Cargo.toml6
-rw-r--r--bin/core/imag-mv/Cargo.toml6
-rw-r--r--bin/core/imag-ref/Cargo.toml6
-rw-r--r--bin/core/imag-store/Cargo.toml6
-rw-r--r--bin/core/imag-store/src/retrieve.rs2
-rw-r--r--bin/core/imag-tag/Cargo.toml6
-rw-r--r--bin/core/imag-view/Cargo.toml6
-rw-r--r--bin/core/imag/Cargo.toml6
-rw-r--r--bin/core/imag/src/main.rs4
-rw-r--r--bin/domain/imag-bookmark/Cargo.toml6
-rw-r--r--bin/domain/imag-bookmark/src/main.rs2
-rw-r--r--bin/domain/imag-diary/Cargo.toml6
-rw-r--r--bin/domain/imag-mail/Cargo.toml6
-rw-r--r--bin/domain/imag-notes/Cargo.toml6
-rw-r--r--bin/domain/imag-timetrack/Cargo.toml6
-rw-r--r--bin/domain/imag-timetrack/src/day.rs6
-rw-r--r--bin/domain/imag-timetrack/src/list.rs6
-rw-r--r--bin/domain/imag-timetrack/src/month.rs6
-rw-r--r--bin/domain/imag-timetrack/src/week.rs6
-rw-r--r--bin/domain/imag-timetrack/src/year.rs6
-rw-r--r--bin/domain/imag-todo/Cargo.toml6
-rw-r--r--lib/core/libimagerror/Cargo.toml6
-rw-r--r--lib/core/libimagrt/Cargo.toml6
-rw-r--r--lib/core/libimagrt/src/logger.rs69
-rw-r--r--lib/core/libimagstore/Cargo.toml6
-rw-r--r--lib/core/libimagstore/src/file_abstraction/fs.rs20
-rw-r--r--lib/core/libimagstore/src/file_abstraction/inmemory.rs6
-rw-r--r--lib/core/libimagstore/src/file_abstraction/stdio/mapper/json.rs10
-rw-r--r--lib/core/libimagstore/src/file_abstraction/stdio/mod.rs9
-rw-r--r--lib/core/libimagstore/src/file_abstraction/stdio/out.rs2
-rw-r--r--lib/core/libimagstore/src/store.rs119
-rw-r--r--lib/core/libimagstore/src/storeid.rs8
-rw-r--r--lib/core/libimagstore/src/util.rs2
-rw-r--r--lib/domain/libimagbookmark/Cargo.toml6
-rw-r--r--lib/domain/libimagdiary/Cargo.toml6
-rw-r--r--lib/domain/libimagdiary/src/diaryid.rs12
-rw-r--r--lib/domain/libimagdiary/src/viewer.rs4
-rw-r--r--lib/domain/libimagmail/Cargo.toml6
-rw-r--r--lib/domain/libimagmail/src/hasher.rs6
-rw-r--r--lib/domain/libimagnotes/Cargo.toml6
-rw-r--r--lib/domain/libimagnotes/src/notestore.rs4
-rw-r--r--lib/domain/libimagtimetrack/Cargo.toml6
-rw-r--r--lib/domain/libimagtodo/Cargo.toml6
-rw-r--r--lib/domain/libimagtodo/src/taskstore.rs18
-rw-r--r--lib/entry/libimagentryannotation/Cargo.toml6
-rw-r--r--lib/entry/libimagentryannotation/src/annotateable.rs10
-rw-r--r--lib/entry/libimagentrycategory/Cargo.toml6
-rw-r--r--lib/entry/libimagentrycategory/src/register.rs8
-rw-r--r--lib/entry/libimagentrydatetime/Cargo.toml6
-rw-r--r--lib/entry/libimagentrydatetime/src/datetime.rs20
-rw-r--r--lib/entry/libimagentryedit/Cargo.toml6
-rw-r--r--lib/entry/libimagentryfilter/Cargo.toml6
-rw-r--r--lib/entry/libimagentrygps/Cargo.toml6
-rw-r--r--lib/entry/libimagentrygps/src/entry.rs2
-rw-r--r--lib/entry/libimagentrylink/Cargo.toml6
-rw-r--r--lib/entry/libimagentrylink/src/external.rs14
-rw-r--r--lib/entry/libimagentrylink/src/internal.rs34
-rw-r--r--lib/entry/libimagentrylist/Cargo.toml6
-rw-r--r--lib/entry/libimagentrylist/src/listers/line.rs2
-rw-r--r--lib/entry/libimagentrylist/src/listers/path.rs6
-rw-r--r--lib/entry/libimagentrymarkdown/Cargo.toml6
-rw-r--r--lib/entry/libimagentrymarkdown/src/processor.rs4
-rw-r--r--lib/entry/libimagentryref/Cargo.toml6
-rw-r--r--lib/entry/libimagentryref/src/flags.rs4
-rw-r--r--lib/entry/libimagentryref/src/hasher.rs2
-rw-r--r--lib/entry/libimagentryref/src/hashers/nbytes.rs4
-rw-r--r--lib/entry/libimagentryref/src/lister.rs2
-rw-r--r--lib/entry/libimagentryref/src/reference.rs16
-rw-r--r--lib/entry/libimagentryref/src/refstore.rs23
-rw-r--r--lib/entry/libimagentrytag/Cargo.toml6
-rw-r--r--lib/entry/libimagentrytag/src/tagable.rs10
-rw-r--r--lib/entry/libimagentryview/Cargo.toml6
-rw-r--r--lib/etc/libimaginteraction/Cargo.toml6
-rw-r--r--lib/etc/libimaginteraction/src/format.rs34
-rw-r--r--lib/etc/libimaginteraction/src/readline.rs38
-rw-r--r--lib/etc/libimaginteraction/src/ui.rs6
-rw-r--r--lib/etc/libimagtimeui/Cargo.toml6
-rw-r--r--lib/etc/libimagutil/Cargo.toml6
-rw-r--r--lib/etc/libimagutil/src/edit.rs6
83 files changed, 523 insertions, 291 deletions
diff --git a/README.md b/README.md
index 681ae8b..ae0413b 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.
diff --git a/bin/core/imag-annotate/Cargo.toml b/bin/core/imag-annotate/Cargo.toml
index f76e8f1..aabeffa 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 3824e51..1314f77 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 f56ba32..4525cb7 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 12ab562..68344aa 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 d3eaf1d..4eb2c98 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 1e19add..3faf611 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 feee3a6..ad3c207 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-store/src/retrieve.rs b/bin/core/imag-store/src/retrieve.rs
index 5c664f9..905fe98 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()
diff --git a/bin/core/imag-tag/Cargo.toml b/bin/core/imag-tag/Cargo.toml
index 969bbcd..0d8b790 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 7a3bcff..488f2f6 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 9249bee..140cd12 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/core/imag/src/main.rs b/bin/core/imag/src/main.rs
index 0b75574..0047f25 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<BTreeMap<String, String>, 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();
diff --git a/bin/domain/imag-bookmark/Cargo.toml b/bin/domain/imag-bookmark/Cargo.toml
index 1f49202..13b6f73 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-bookmark/src/main.rs b/bin/domain/imag-bookmark/src/main.rs
index 7f2131c..3529b0e 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(())
})
diff --git a/bin/domain/imag-diary/Cargo.toml b/bin/domain/imag-diary/Cargo.toml
index 606ca0b..a1ad5a4 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 f758314..bc05582 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 246010b..0e97826 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 c8ad0d7..52938e1 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-timetrack/src/day.rs b/bin/domain/imag-timetrack/src/day.rs
index bd76867..2925122 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 25c0ce0..109a7ae 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 80ddd8f..144b109 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 39acdf1..1043989 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 11b0197..a5ce27f 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) {
diff --git a/bin/domain/imag-todo/Cargo.toml b/bin/domain/imag-todo/Cargo.toml
index bcf8bea..994857c 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 8c26d68..56300ea 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 867f358..88c27d2 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/libimagrt/src/logger.rs b/lib/core/libimagrt/src/logger.rs
index 60f50d6..5a4d80e 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<Value>) -> Result<Vec<LogDestination>> {
.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.<mod>.destinations".to_owned();
let ty = "Array<String>";
@@ -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,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 = try!(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.<mod>.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 = try!(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.<mod>.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 = try!(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.<mod>.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,
diff --git a/lib/core/libimagstore/Cargo.toml b/lib/core/libimagstore/Cargo.toml
index 0f664d3..0fce876 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/core/libimagstore/src/file_abstraction/fs.rs b/lib/core/libimagstore/src/file_abstraction/fs.rs
index 0773a17..7dad336 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 9a9adf6..094a5af 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 3bd46d6..7bc8fc9 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 7bf4f42..5b93f6f 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<W, M> StdIoFileAbstraction<W, M>
pub fn new<R: Read>(in_stream: &mut R, out_stream: Rc<RefCell<W>>, mapper: M) -> Result<StdIoFileAbstraction<W, M>, 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 c8540b3..5f62e89 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<W: Write, M: Mapper> FileAbstraction for StdoutFileAbstraction<W, M> {
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 21e42e4..cdbebb5 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<FileAbstraction>) -> Result<StoreEntry> {
- 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<FileLockEntry<'a>> {
- 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<FileLockEntry<'a>> {
- 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<Option<FileLockEntry<'a>>> {
- 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<S: IntoStoreId>(&self, id: S) -> Result<Entry> {
- 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<S: IntoStoreId>(&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<S: IntoStoreId>(loc: S, file: &mut Read) -> Result<Entry> {
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<S: IntoStoreId>(loc: S, s: &str) -> Result<Entry> {
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 94fa343..dde25a2 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<D>(store_part: &PathBuf, full_path: D) -> Result<StoreId>
where D: Deref<Target = Path>
{
- 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<PathBuf> {
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 e77e8eb..040881d 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)))
}
diff --git a/lib/domain/libimagbookmark/Cargo.toml b/lib/domain/libimagbookmark/Cargo.toml
index 2d00ec1..7aa55f4 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 16350ac..c36184e 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/libimagdiary/src/diaryid.rs b/lib/domain/libimagdiary/src/diaryid.rs
index 0d47002..43aab1c 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<u32,_> = next_component(&mut cmps)
.and_then(|s| s.parse::<u32>()
@@ -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 b37061b..cf37b8e 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");
}
diff --git a/lib/domain/libimagmail/Cargo.toml b/lib/domain/libimagmail/Cargo.toml
index f7f6fa3..145aa48 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/libimagmail/src/hasher.rs b/lib/domain/libimagmail/src/hasher.rs
index 3d3ff70..79e8deb 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<String> = 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);
}
diff --git a/lib/domain/libimagnotes/Cargo.toml b/lib/domain/libimagnotes/Cargo.toml
index b2fa6a1..02a5a09 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/libimagnotes/src/notestore.rs b/lib/domain/libimagnotes/src/notestore.rs
index b16de61..0547b68 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();
diff --git a/lib/domain/libimagtimetrack/Cargo.toml b/lib/domain/libimagtimetrack/Cargo.toml
index 2c89936..73178cf 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 88a4ca6..f53adaa 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/domain/libimagtodo/src/taskstore.rs b/lib/domain/libimagtodo/src/taskstore.rs
index 4a1dc2f..9febe2e 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<R: BufRead>(&'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<R: BufRead>(&'a self, mut r: R) -> Result<RResult<FileLockEntry<'a>, 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<R: BufRead>(&'a self, mut r: R) -> Result<FileLockEntry<'a>> {
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)
}
@@ -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(())
@@ -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
diff --git a/lib/entry/libimagentryannotation/Cargo.toml b/lib/entry/libimagentryannotation/Cargo.toml
index 430c509..c352077 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/libimagentryannotation/src/annotateable.rs b/lib/entry/libimagentryannotation/src/annotateable.rs
index 356e66c..ffd4087 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<FileLockEntry<'a>> {
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<Option<FileLockEntry<'a>>> {
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));
}
}
diff --git a/lib/entry/libimagentrycategory/Cargo.toml b/lib/entry/libimagentrycategory/Cargo.toml
index 2888231..b8a9610 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/libimagentrycategory/src/register.rs b/lib/entry/libimagentrycategory/src/register.rs
index 67cb687..af23d5b 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<bool> {
- 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<bool> {
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<Option<FileLockEntry>> {
- 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)
diff --git a/lib/entry/libimagentrydatetime/Cargo.toml b/lib/entry/libimagentrydatetime/Cargo.toml
index 6309f92..38d8367 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/libimagentrydatetime/src/datetime.rs b/lib/entry/libimagentrydatetime/src/datetime.rs
index 420f65f..692f1d5 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<DateTimeRange> {
- 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))) => {
diff --git a/lib/entry/libimagentryedit/Cargo.toml b/lib/entry/libimagentryedit/Cargo.toml
index f038e5b..0197b6c 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 1db247d..2f0ee40 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 5fd87a6..ab6aa88 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/libimagentrygps/src/entry.rs b/lib/entry/libimagentrygps/src/entry.rs
index 1e54157..3383e25 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 {
diff --git a/lib/entry/libimagentrylink/Cargo.toml b/lib/entry/libimagentrylink/Cargo.toml
index cf1f086..c7981e5 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/libimagentrylink/src/external.rs b/lib/entry/libimagentrylink/src/external.rs
index 1211da3..c3eccfa 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 5b53196..1598feb 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<I: Iterator<Item = Link>>(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<I: Iterator<Item = Link>>(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<Option<Value>>) -> Result<LinkIter> {
return Err(LEK::ExistingLinkTypeWrong.into());
}
- let links : Vec<Link> = try!(links.into_iter()
+ let links : Vec<Link> = links.into_iter()
.map(|link| {
debug!("Matching the link: {:?}", link);
match link {
@@ -566,11 +566,11 @@ fn process_rw_result(links: Result<Option<Value>>) -> Result<LinkIter> {
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<Option<Value>>) -> Result<LinkIter> {
_ => unreachable!(),
}
})
- .collect());
+ .collect::<Result<Vec<Link>>>()?;
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(())
})
diff --git a/lib/entry/libimagentrylist/Cargo.toml b/lib/entry/libimagentrylist/Cargo.toml
index 88c0a32..76d2b72 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/libimagentrylist/src/listers/line.rs b/lib/entry/libimagentrylist/src/listers/line.rs
index b4c2639..8f89e66 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 f45239d..b88d43f 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(())
diff --git a/lib/entry/libimagentrymarkdown/Cargo.toml b/lib/entry/libimagentrymarkdown/Cargo.toml
index 67153d6..c0f1443 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/libimagentrymarkdown/src/processor.rs b/lib/entry/libimagentrymarkdown/src/processor.rs
index f003649..943990a 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)?;
},
diff --git a/lib/entry/libimagentryref/Cargo.toml b/lib/entry/libimagentryref/Cargo.toml
index abea8df..c68167c 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/libimagentryref/src/flags.rs b/lib/entry/libimagentryref/src/flags.rs
index a15a97c..2d87c7c 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 d50c08c..79088c2 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<R: Read>(&mut self, _: &PathBuf, c: &mut R) -> Result<String> {
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 de2e311..dd91004 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<R: Read>(&mut self, _: &PathBuf, contents: &mut R) -> Result<String> {
- let s : String = try!(contents
+ let s : String = contents
.bytes()
.take(self.n)
.collect::<RResult<Vec<u8>, _>>()
.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 0cf4d5b..e3d9bdf 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 3643dab..c043b1e 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<bool> {
- 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<H: 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 102d3d9..8a7413b 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 [
diff --git a/lib/entry/libimagentrytag/Cargo.toml b/lib/entry/libimagentrytag/Cargo.toml
index 7619457..112f83e 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/libimagentrytag/src/tagable.rs b/lib/entry/libimagentrytag/src/tagable.rs
index 7b9687a..601bc90 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<Vec<Tag>> {
- 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<bool> {
- 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<bool> {
let mut result = true;
for tag in tags {
- result = result && try!(self.has_tag(tag));
+ result = result && self.has_tag(tag)?;
}
Ok(result)
diff --git a/lib/entry/libimagentryview/Cargo.toml b/lib/entry/libimagentryview/Cargo.toml
index 7c13c05..16fb5b1 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 0789629..9dfc7f6 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/libimaginteraction/src/format.rs b/lib/etc/libimaginteraction/src/format.rs
index 409c072..e39f92c 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<u64, RenderError> {
- 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::<String>()));
+ let text = h.param(1).ok_or(RenderError::new("Too few arguments"))?.value().render();
+ write!(rc.writer(), "{}", text.chars().take(count).collect::<String>())?;
Ok(())
}
}
diff --git a/lib/etc/libimaginteraction/src/readline.rs b/lib/etc/libimaginteraction/src/readline.rs
index 3f9a639..86aa51a 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<Readline> {
- 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 d1712f9..9c16a2a 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<Vec<StoreId>> {
.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<Ve
Ok(v) => 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])
},
}
diff --git a/lib/etc/libimagtimeui/Cargo.toml b/lib/etc/libimagtimeui/Cargo.toml
index 8e46135..f92794f 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 be1b1af..aca2ed1 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"
diff --git a/lib/etc/libimagutil/src/edit.rs b/lib/etc/libimagutil/src/edit.rs
index 5d1838f..bab3c8e 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<bool, IOError> {
- 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()