mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-16 09:35:19 +00:00
Merge pull request #1843 from RustPython/coolreader18/clippy-fixes
Fix some clippy lints that were previously 'allow'ed
This commit is contained in:
commit
3f2b414fcc
1 changed files with 5 additions and 8 deletions
|
@ -739,7 +739,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();
|
||||
|
@ -775,13 +774,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