Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Nov 28, 2023
1 parent 2c7af4e commit 3d679ce
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
12 changes: 7 additions & 5 deletions crates/codegen/parser/runtime/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,14 @@ impl Cursor {
/// In contrast to `Iterator::find_*`, this does not consume the first item when found.
pub fn find_matching<R, F: Fn(&Node) -> Option<R>>(&mut self, predicate: F) -> Option<R> {
while !self.is_completed {
let result = predicate(&self.current.node);
if matches!(result, Some(_)) {
return result;
match predicate(&self.current.node) {
result @ Some(_) => {
return result;
}
None => {
self.go_to_next();
}
}

self.go_to_next();
}

None
Expand Down
12 changes: 7 additions & 5 deletions crates/solidity/outputs/cargo/crate/src/generated/cursor.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions crates/solidity/outputs/npm/crate/src/generated/cursor.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3d679ce

Please sign in to comment.