diff --git a/.travis.yml b/.travis.yml index 983d22b38..47efee28f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: rust sudo: true rust: - - 1.46.0 + - 1.47.0 jobs: include: diff --git a/src/parser/xml.rs b/src/parser/xml.rs index b4dbbc08d..ff55c1235 100644 --- a/src/parser/xml.rs +++ b/src/parser/xml.rs @@ -58,10 +58,7 @@ pub fn parse(reader: &mut Reader) -> ParseResult<'static, String> { } fn is_valid(s: &str) -> bool { - match parser::parse(s) { - Ok(_) => true, - _ => false, - } + matches!(parser::parse(s), Ok(_)) } #[cfg(test)] diff --git a/src/runner/predicate.rs b/src/runner/predicate.rs index 9ce5877ae..3a038c832 100644 --- a/src/runner/predicate.rs +++ b/src/runner/predicate.rs @@ -112,11 +112,7 @@ impl PredicateFunc { ) -> Result { match optional_value { None => { - let type_mismatch = if let PredicateFuncValue::Exist {} = self.value { - false - } else { - true - }; + let type_mismatch = !matches!(self.value, PredicateFuncValue::Exist {}); Ok(AssertResult { success: false, actual: "none".to_string(), diff --git a/src/runner/template.rs b/src/runner/template.rs index 2685b6c4d..e04591c52 100644 --- a/src/runner/template.rs +++ b/src/runner/template.rs @@ -71,10 +71,7 @@ impl TemplateElement { impl Value { pub fn is_renderable(&self) -> bool { - match self { - Value::Integer(_) | Value::Bool(_) | Value::Float(_, _) | Value::String(_) => true, - _ => false, - } + matches!(self, Value::Integer(_) | Value::Bool(_) | Value::Float(_, _) | Value::String(_)) } } diff --git a/src/runner/value.rs b/src/runner/value.rs index d6033140d..6730ebb63 100644 --- a/src/runner/value.rs +++ b/src/runner/value.rs @@ -89,10 +89,7 @@ impl Value { } pub fn is_scalar(&self) -> bool { - match self { - Value::Nodeset(_) | Value::List(_) => false, - _ => true, - } + !matches!(self, Value::Nodeset(_) | Value::List(_)) } }