Replace unwrap() with try!()
This commit is contained in:
parent
f43f227042
commit
27009be687
1 changed files with 1 additions and 6 deletions
|
@ -30,12 +30,7 @@ pub trait Tagable {
|
||||||
impl Tagable for EntryHeader {
|
impl Tagable for EntryHeader {
|
||||||
|
|
||||||
fn get_tags(&self) -> Result<Vec<Tag>> {
|
fn get_tags(&self) -> Result<Vec<Tag>> {
|
||||||
let tags = self.read("imag.tags");
|
let tags = try!(self.read("imag.tags").map_err_into(TagErrorKind::HeaderReadError));
|
||||||
if tags.is_err() {
|
|
||||||
let kind = TagErrorKind::HeaderReadError;
|
|
||||||
return Err(kind.into_error_with_cause(Box::new(tags.unwrap_err())));
|
|
||||||
}
|
|
||||||
let tags = tags.unwrap();
|
|
||||||
|
|
||||||
match tags {
|
match tags {
|
||||||
Some(Value::Array(tags)) => {
|
Some(Value::Array(tags)) => {
|
||||||
|
|
Loading…
Reference in a new issue