Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscerie committed May 25, 2024
1 parent 987f4ea commit 6a6d2dd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions selene-lib/src/ast_util/scopes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,11 +830,7 @@ impl Visitor for ScopeVisitor {

fn visit_block(&mut self, block: &ast::Block) {
if let Some((start, end)) = block.range() {
if self
.else_blocks
.get(&(start.bytes(), end.bytes()))
.is_some()
{
if self.else_blocks.contains(&(start.bytes(), end.bytes())) {
self.close_scope(); // close the if or elseif's block
self.open_scope(block);
}
Expand All @@ -843,11 +839,7 @@ impl Visitor for ScopeVisitor {

fn visit_block_end(&mut self, block: &ast::Block) {
if let Some((start, end)) = block.range() {
if self
.else_blocks
.get(&(start.bytes(), end.bytes()))
.is_some()
{
if self.else_blocks.contains(&(start.bytes(), end.bytes())) {
self.close_scope();
}
}
Expand Down

0 comments on commit 6a6d2dd

Please sign in to comment.