From c27abf862f44aed1dba8f558cd31a2bc941dc294 Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Mon, 16 Mar 2020 20:56:45 -0500 Subject: [PATCH] Fix some clippy lints that were 'allow'ed --- src/symboltable.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/symboltable.rs b/src/symboltable.rs index d08aa4f..0ad3633 100644 --- a/src/symboltable.rs +++ b/src/symboltable.rs @@ -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!