Skip to content

Commit 5943f2c

Browse files
committed
fix some clippy errors from the latest rust version
1 parent bb74713 commit 5943f2c

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/tokenizer.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -727,10 +727,7 @@ impl<'a> Tokenizer<'a> {
727727
// match binary literal that starts with 0x
728728
if s == "0" && chars.peek() == Some(&'x') {
729729
chars.next();
730-
let s2 = peeking_take_while(
731-
chars,
732-
|ch| matches!(ch, '0'..='9' | 'A'..='F' | 'a'..='f'),
733-
);
730+
let s2 = peeking_take_while(chars, |ch| ch.is_ascii_hexdigit());
734731
return Ok(Some(Token::HexStringLiteral(s2)));
735732
}
736733

@@ -1077,7 +1074,7 @@ impl<'a> Tokenizer<'a> {
10771074
match chars.peek() {
10781075
Some('$') => {
10791076
chars.next();
1080-
for (_, c) in value.chars().enumerate() {
1077+
for c in value.chars() {
10811078
let next_char = chars.next();
10821079
if Some(c) != next_char {
10831080
return self.tokenizer_error(

tests/sqlparser_postgres.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3262,7 +3262,7 @@ fn parse_dollar_quoted_string() {
32623262

32633263
let stmt = pg().parse_sql_statements(sql).unwrap();
32643264

3265-
let projection = match stmt.get(0).unwrap() {
3265+
let projection = match stmt.first().unwrap() {
32663266
Statement::Query(query) => match &*query.body {
32673267
SetExpr::Select(select) => &select.projection,
32683268
_ => unreachable!(),

0 commit comments

Comments
 (0)