mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix nightly clippy
This commit is contained in:
1 parent
3b2db89d1e
commit
3cd0a1118d
10 files changed
+26
-64
No files matched your search
@@ -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
@@ -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,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user