Merge pull request #33 from Orange-OpenSource/feature/update-rust-1.47.0

Update to rust 1.47.0
This commit is contained in:
Fabrice Reix 2020-10-11 21:08:05 +02:00 committed by GitHub
commit 00de621f1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 18 deletions

View File

@ -1,7 +1,7 @@
language: rust
sudo: true
rust:
- 1.46.0
- 1.47.0
jobs:
include:

View File

@ -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)]

View File

@ -112,11 +112,7 @@ impl PredicateFunc {
) -> Result<AssertResult, Error> {
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(),

View File

@ -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(_))
}
}

View File

@ -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(_))
}
}