libimagentrylink: Refactor code with is_match!() macro

This commit is contained in:
Matthias Beyer 2016-05-23 21:42:49 +02:00
parent 0e03998499
commit 394b90f038

View file

@ -160,7 +160,7 @@ fn process_rw_result(links: StoreResult<Option<Value>>) -> Result<Vec<Link>> {
} }
}; };
if !links.iter().all(|l| match *l { Value::String(_) => true, _ => false }) { if !links.iter().all(|l| is_match!(*l, Value::String(_))) {
debug!("At least one of the Values which were expected in the Array of links is a non-String!"); debug!("At least one of the Values which were expected in the Array of links is a non-String!");
debug!("Generating LinkError"); debug!("Generating LinkError");
return Err(LinkError::new(LinkErrorKind::ExistingLinkTypeWrong, None)); return Err(LinkError::new(LinkErrorKind::ExistingLinkTypeWrong, None));