Skip to content

Commit

Permalink
Fix get_then_check clippy (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscerie authored May 25, 2024
1 parent cbd7746 commit a7b4a53
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 a7b4a53

Please sign in to comment.