mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-03 18:29:04 +00:00
Fix nightly clippy
This commit is contained in:
parent
6c96793f05
commit
09b8414162
2 changed files with 6 additions and 21 deletions
|
@ -61,10 +61,7 @@ enum FunctionContext {
|
|||
|
||||
impl CompileContext {
|
||||
fn in_func(self) -> bool {
|
||||
match self.func {
|
||||
FunctionContext::NoFunction => false,
|
||||
_ => true,
|
||||
}
|
||||
!matches!(self.func, FunctionContext::NoFunction)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2006,13 +2003,9 @@ impl<O: OutputStream> Compiler<O> {
|
|||
// a list of expressions on the stack, or a list of tuples.
|
||||
fn gather_elements(&mut self, elements: &[ast::Expression]) -> CompileResult<bool> {
|
||||
// First determine if we have starred elements:
|
||||
let has_stars = elements.iter().any(|e| {
|
||||
if let ast::ExpressionType::Starred { .. } = &e.node {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
});
|
||||
let has_stars = elements
|
||||
.iter()
|
||||
.any(|e| matches!(e.node, ast::ExpressionType::Starred { .. }));
|
||||
|
||||
for element in elements {
|
||||
if let ast::ExpressionType::Starred { value } = &element.node {
|
||||
|
|
|
@ -136,19 +136,11 @@ impl Symbol {
|
|||
}
|
||||
|
||||
pub fn is_global(&self) -> bool {
|
||||
if let SymbolScope::Global = self.scope {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
matches!(self.scope, SymbolScope::Global)
|
||||
}
|
||||
|
||||
pub fn is_local(&self) -> bool {
|
||||
if let SymbolScope::Local = self.scope {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
matches!(self.scope, SymbolScope::Local)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue