summaryrefslogtreecommitdiff
path: root/lib/entry/libimagentrytag
diff options
context:
space:
mode:
Diffstat (limited to 'lib/entry/libimagentrytag')
-rw-r--r--lib/entry/libimagentrytag/Cargo.toml6
-rw-r--r--lib/entry/libimagentrytag/src/tagable.rs10
2 files changed, 11 insertions, 5 deletions
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)