Skip to content

Commit

Permalink
Fix clippy issues
Browse files Browse the repository at this point in the history
Signed-off-by: Toby Hede <toby@cipherstash.com>
  • Loading branch information
tobyhede committed Dec 31, 2023
1 parent 7727c64 commit 194b686
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rust 1.73.0
rust 1.75.0
1 change: 1 addition & 0 deletions src/dialect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ mod tests {
}
}

#[allow(clippy::needless_raw_string_hashes)]
let statement = r#"SELECT 'Wayne\'s World'"#;
let res1 = Parser::parse_sql(&MySqlDialect {}, statement);
let res2 = Parser::parse_sql(&WrappedDialect(MySqlDialect {}), statement);
Expand Down
7 changes: 2 additions & 5 deletions src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,7 @@ impl<'a> Tokenizer<'a> {
// match binary literal that starts with 0x
if s == "0" && chars.peek() == Some(&'x') {
chars.next();
let s2 = peeking_take_while(
chars,
|ch| matches!(ch, '0'..='9' | 'A'..='F' | 'a'..='f'),
);
let s2 = peeking_take_while(chars, |ch| ch.is_ascii_hexdigit());
return Ok(Some(Token::HexStringLiteral(s2)));
}

Expand Down Expand Up @@ -1077,7 +1074,7 @@ impl<'a> Tokenizer<'a> {
match chars.peek() {
Some('$') => {
chars.next();
for (_, c) in value.chars().enumerate() {
for c in value.chars() {
let next_char = chars.next();
if Some(c) != next_char {
return self.tokenizer_error(
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlparser_postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3272,7 +3272,7 @@ fn parse_dollar_quoted_string() {

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

let projection = match stmt.get(0).unwrap() {
let projection = match stmt.first().unwrap() {
Statement::Query(query) => match &*query.body {
SetExpr::Select(select) => &select.projection,
_ => unreachable!(),
Expand Down

0 comments on commit 194b686

Please sign in to comment.