Skip to content

Commit

Permalink
chore: apply clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
KieranKaelin committed Dec 21, 2022
1 parent d1d2711 commit 736dbde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,14 @@ impl QualifiedIdent {
.filter(|it| it.kind() == SyntaxKind::Ident)
.last()
.map(|it| it.text().into())
.into()
}

pub fn qualifier(&self) -> Option<SqlIdent> {
self.syntax
.children_with_tokens()
.filter_map(|it| it.into_token())
.filter(|it| it.kind() == SyntaxKind::Ident)
.next()
.find(|it| it.kind() == SyntaxKind::Ident)
.map(|it| it.text().into())
.into()
}
}

Expand Down Expand Up @@ -176,12 +173,9 @@ impl Param {
.filter_map(|it| it.into_token())
.find(|t| t.kind() == SyntaxKind::Keyword && t.text().to_lowercase() == "%type")?;

// TODO: Resolve Option nesting
type_kw
.prev_sibling_or_token()
.map(|t| t.into_node())
.flatten()
.map(QualifiedIdent::cast)
.flatten()
.and_then(|t| t.into_node())
.and_then(QualifiedIdent::cast)
}
}
2 changes: 1 addition & 1 deletion src/grammar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ fn parse_qualified_ident(p: &mut Parser, expected_components: Range<u8>) {
}

parse_ident(p);
i = i + 1;
i += 1;
}

if i > 1 {
Expand Down

0 comments on commit 736dbde

Please sign in to comment.