diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-08-04 14:04:59 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-08-04 19:22:30 +0200 |
commit | 27009be687637e808d3bc39bbdb064e3342181e6 (patch) | |
tree | dc554adb2700fd50e74ebe1039d8893742a5e745 /libimagentrytag | |
parent | f43f22704248d82d95fae9cd6a1e8d584b2e7e31 (diff) |
Replace unwrap() with try!()
Diffstat (limited to 'libimagentrytag')
-rw-r--r-- | libimagentrytag/src/tagable.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/libimagentrytag/src/tagable.rs b/libimagentrytag/src/tagable.rs index f4859863..6dc6d6c6 100644 --- a/libimagentrytag/src/tagable.rs +++ b/libimagentrytag/src/tagable.rs @@ -30,12 +30,7 @@ pub trait Tagable { impl Tagable for EntryHeader { fn get_tags(&self) -> Result<Vec<Tag>> { - let tags = self.read("imag.tags"); - if tags.is_err() { - let kind = TagErrorKind::HeaderReadError; - return Err(kind.into_error_with_cause(Box::new(tags.unwrap_err()))); - } - let tags = tags.unwrap(); + let tags = try!(self.read("imag.tags").map_err_into(TagErrorKind::HeaderReadError)); match tags { Some(Value::Array(tags)) => { |