Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Huene <[email protected]>
  • Loading branch information
a-frantz and peterhuene authored Oct 3, 2024
1 parent 91ab99a commit 4496948
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wdl-lint/src/rules/blank_lines_between_elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,10 +586,11 @@ fn check_last_token(
let prev = syntax
.last_token()
.expect("Node should have last token")
.prev_sibling_or_token();
.prev_sibling_or_token()
.and_then(SyntaxElement::into_token);
if let Some(prev) = prev {
if prev.kind() == SyntaxKind::Whitespace {
let count = prev.to_string().chars().filter(|c| *c == '\n').count();
let count = prev.text().chars().filter(|c| *c == '\n').count();
if count > 1 {
state.exceptable_add(
excess_blank_line(prev.text_range().to_span()),
Expand Down

0 comments on commit 4496948

Please sign in to comment.