Fix nightly clippy

This commit is contained in:
Jeong YunWon committed 2020-10-01 07:08:55 +09:00
1 parent 3b2db89d1e
commit 3cd0a1118d
10 files changed
+26 -64

No files matched your search

+1 -5
View File
@@ -79,9 +79,5 @@ pub fn parse_args(func_args: Vec<FunctionArgument>) -> Result<ast::ArgumentList,
}
fn is_starred(exp: &ast::Expression) -> bool {
if let ast::ExpressionType::Starred { .. } = exp.node {
true
} else {
false
}
matches!(exp.node, ast::ExpressionType::Starred { .. })
}
+6 -21
View File
@@ -393,23 +393,11 @@ where
/// Test if a digit is of a certain radix.
fn is_digit_of_radix(c: Option<char>, radix: u32) -> bool {
match radix {
2 => match c {
Some('0'..='1') => true,
_ => false,
},
8 => match c {
Some('0'..='7') => true,
_ => false,
},
10 => match c {
Some('0'..='9') => true,
_ => false,
},
16 => match c {
Some('0'..='9') | Some('a'..='f') | Some('A'..='F') => true,
_ => false,
},
x => unimplemented!("Radix not implemented: {}", x),
2 => matches!(c, Some('0'..='1')),
8 => matches!(c, Some('0'..='7')),
10 => matches!(c, Some('0'..='9')),
16 => matches!(c, Some('0'..='9') | Some('a'..='f') | Some('A'..='F')),
other => unimplemented!("Radix not implemented: {}", other),
}
}
@@ -417,10 +405,7 @@ where
fn at_exponent(&self) -> bool {
match self.chr0 {
Some('e') | Some('E') => match self.chr1 {
Some('+') | Some('-') => match self.chr2 {
Some('0'..='9') => true,
_ => false,
},
Some('+') | Some('-') => matches!(self.chr2, Some('0'..='9')),
Some('0'..='9') => true,
_ => false,
},