mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-14 08:35:21 +00:00
Fix some clippy lints that were 'allow'ed
This commit is contained in:
parent
1e12aa8afe
commit
c27abf862f
1 changed files with 5 additions and 8 deletions
|
@ -741,7 +741,6 @@ impl SymbolTableBuilder {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(clippy::single_match)]
|
||||
fn register_name(&mut self, name: &str, role: SymbolUsage) -> SymbolTableResult {
|
||||
let scope_depth = self.tables.len();
|
||||
let table = self.tables.last_mut().unwrap();
|
||||
|
@ -777,13 +776,11 @@ impl SymbolTableBuilder {
|
|||
|
||||
// Some more checks:
|
||||
match role {
|
||||
SymbolUsage::Nonlocal => {
|
||||
if scope_depth < 2 {
|
||||
return Err(SymbolTableError {
|
||||
error: format!("cannot define nonlocal '{}' at top level.", name),
|
||||
location,
|
||||
});
|
||||
}
|
||||
SymbolUsage::Nonlocal if scope_depth < 2 => {
|
||||
return Err(SymbolTableError {
|
||||
error: format!("cannot define nonlocal '{}' at top level.", name),
|
||||
location,
|
||||
})
|
||||
}
|
||||
_ => {
|
||||
// Ok!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue