Skip to content

Commit 6b562d7

Browse files
authored
fix warnings (#31)
* chore: Align lifetime syntax to satisfy `mismatched_lifetime_syntaxes` lint source: https://doc.rust-lang.org/beta/nightly-rustc/rustc_lint/lifetime_syntax/static.MISMATCHED_LIFETIME_SYNTAXES.html * chore: resolve `non_canonical_partial_ord_impl` lint source: https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl * chore: resolve `collapsible_if` lint by clippy source: https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if --------- Co-authored-by: Taishi Naka <lemonadern@users.noreply.github.com>
1 parent 449673d commit 6b562d7

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

crates/automata/src/nfa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl PartialEq for NFAState<'_> {
3939

4040
impl PartialOrd for NFAState<'_> {
4141
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
42-
Some(self.state_id.cmp(&other.state_id))
42+
Some(self.cmp(other))
4343
}
4444
}
4545

crates/parser-generator/src/parser_generator/lexer/lexer_ported.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ pub fn init_tokens(tokens: &mut [Token]) {
162162
for i in 0..tokens.len() - 1 {
163163
match &tokens[i].kind {
164164
TokenKind::KEYWORD(k) if k == "FORMAT" => {
165-
if let Some(j) = next_token_index(tokens, i) {
166-
if tokens[j].kind == TokenKind::KEYWORD("JSON".to_string()) {
167-
tokens[i].kind = TokenKind::KEYWORD("FORMAT_LA".to_string());
168-
}
165+
if let Some(j) = next_token_index(tokens, i)
166+
&& tokens[j].kind == TokenKind::KEYWORD("JSON".to_string())
167+
{
168+
tokens[i].kind = TokenKind::KEYWORD("FORMAT_LA".to_string());
169169
}
170170
}
171171
TokenKind::KEYWORD(k) if k == "NOT" => {

crates/postgresql-cst-parser/src/cst/lr_parse_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl<'a> LRParseState<'a> {
1616
matches!(self.extras.last(), Some(e) if e.end_byte_pos != self.token.start_byte_pos && e.kind == SyntaxKind::C_COMMENT)
1717
}
1818

19-
pub(crate) fn previous_extra(&self) -> Option<&Extra> {
19+
pub(crate) fn previous_extra(&self) -> Option<&Extra<'_>> {
2020
let last_extra = self.extras.last()?;
2121

2222
let stack_end_byte_pos = self

crates/postgresql-cst-parser/src/tree_sitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl Tree {
4747
}
4848
}
4949

50-
pub fn root_node(&self) -> Node {
50+
pub fn root_node(&self) -> Node<'_> {
5151
Node {
5252
input: &self.src,
5353
range_map: Rc::clone(&self.range_map),

0 commit comments

Comments
 (0)