Skip to content

Commit 6291afb

Browse files
authored
Fix clippy warnings on rust 1.83 (#1570)
1 parent 5a510ac commit 6291afb

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

src/ast/ddl.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -1327,15 +1327,18 @@ pub enum ColumnOption {
13271327
/// `DEFAULT <restricted-expr>`
13281328
Default(Expr),
13291329

1330-
/// ClickHouse supports `MATERIALIZE`, `EPHEMERAL` and `ALIAS` expr to generate default values.
1330+
/// `MATERIALIZE <expr>`
13311331
/// Syntax: `b INT MATERIALIZE (a + 1)`
1332+
///
13321333
/// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/create/table#default_values)
1333-
1334-
/// `MATERIALIZE <expr>`
13351334
Materialized(Expr),
13361335
/// `EPHEMERAL [<expr>]`
1336+
///
1337+
/// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/create/table#default_values)
13371338
Ephemeral(Option<Expr>),
13381339
/// `ALIAS <expr>`
1340+
///
1341+
/// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/create/table#default_values)
13391342
Alias(Expr),
13401343

13411344
/// `{ PRIMARY KEY | UNIQUE } [<constraint_characteristics>]`
@@ -1552,7 +1555,7 @@ pub enum GeneratedExpressionMode {
15521555
#[must_use]
15531556
fn display_constraint_name(name: &'_ Option<Ident>) -> impl fmt::Display + '_ {
15541557
struct ConstraintName<'a>(&'a Option<Ident>);
1555-
impl<'a> fmt::Display for ConstraintName<'a> {
1558+
impl fmt::Display for ConstraintName<'_> {
15561559
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
15571560
if let Some(name) = self.0 {
15581561
write!(f, "CONSTRAINT {name} ")?;
@@ -1573,7 +1576,7 @@ fn display_option<'a, T: fmt::Display>(
15731576
option: &'a Option<T>,
15741577
) -> impl fmt::Display + 'a {
15751578
struct OptionDisplay<'a, T>(&'a str, &'a str, &'a Option<T>);
1576-
impl<'a, T: fmt::Display> fmt::Display for OptionDisplay<'a, T> {
1579+
impl<T: fmt::Display> fmt::Display for OptionDisplay<'_, T> {
15771580
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
15781581
if let Some(inner) = self.2 {
15791582
let (prefix, postfix) = (self.0, self.1);

src/ast/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ where
110110
sep: &'static str,
111111
}
112112

113-
impl<'a, T> fmt::Display for DisplaySeparated<'a, T>
113+
impl<T> fmt::Display for DisplaySeparated<'_, T>
114114
where
115115
T: fmt::Display,
116116
{

src/ast/query.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ impl fmt::Display for Join {
17131713
}
17141714
fn suffix(constraint: &'_ JoinConstraint) -> impl fmt::Display + '_ {
17151715
struct Suffix<'a>(&'a JoinConstraint);
1716-
impl<'a> fmt::Display for Suffix<'a> {
1716+
impl fmt::Display for Suffix<'_> {
17171717
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17181718
match self.0 {
17191719
JoinConstraint::On(expr) => write!(f, " ON {expr}"),

src/ast/value.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ pub struct EscapeQuotedString<'a> {
261261
quote: char,
262262
}
263263

264-
impl<'a> fmt::Display for EscapeQuotedString<'a> {
264+
impl fmt::Display for EscapeQuotedString<'_> {
265265
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
266266
// EscapeQuotedString doesn't know which mode of escape was
267267
// chosen by the user. So this code must to correctly display
@@ -325,7 +325,7 @@ pub fn escape_double_quote_string(s: &str) -> EscapeQuotedString<'_> {
325325

326326
pub struct EscapeEscapedStringLiteral<'a>(&'a str);
327327

328-
impl<'a> fmt::Display for EscapeEscapedStringLiteral<'a> {
328+
impl fmt::Display for EscapeEscapedStringLiteral<'_> {
329329
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
330330
for c in self.0.chars() {
331331
match c {
@@ -359,7 +359,7 @@ pub fn escape_escaped_string(s: &str) -> EscapeEscapedStringLiteral<'_> {
359359

360360
pub struct EscapeUnicodeStringLiteral<'a>(&'a str);
361361

362-
impl<'a> fmt::Display for EscapeUnicodeStringLiteral<'a> {
362+
impl fmt::Display for EscapeUnicodeStringLiteral<'_> {
363363
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
364364
for c in self.0.chars() {
365365
match c {

src/parser/alter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::{
2626
tokenizer::Token,
2727
};
2828

29-
impl<'a> Parser<'a> {
29+
impl Parser<'_> {
3030
pub fn parse_alter_role(&mut self) -> Result<Statement, ParserError> {
3131
if dialect_of!(self is PostgreSqlDialect) {
3232
return self.parse_pg_alter_role();

src/parser/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -10883,13 +10883,12 @@ impl<'a> Parser<'a> {
1088310883
Ok(ExprWithAlias { expr, alias })
1088410884
}
1088510885
/// Parses an expression with an optional alias
10886-
10886+
///
1088710887
/// Examples:
10888-
10888+
///
1088910889
/// ```sql
1089010890
/// SUM(price) AS total_price
1089110891
/// ```
10892-
1089310892
/// ```sql
1089410893
/// SUM(price)
1089510894
/// ```
@@ -10905,7 +10904,6 @@ impl<'a> Parser<'a> {
1090510904
/// assert_eq!(Some("b".to_string()), expr_with_alias.alias.map(|x|x.value));
1090610905
/// # Ok(())
1090710906
/// # }
10908-
1090910907
pub fn parse_expr_with_alias(&mut self) -> Result<ExprWithAlias, ParserError> {
1091010908
let expr = self.parse_expr()?;
1091110909
let alias = if self.parse_keyword(Keyword::AS) {

src/tokenizer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ struct State<'a> {
584584
pub col: u64,
585585
}
586586

587-
impl<'a> State<'a> {
587+
impl State<'_> {
588588
/// return the next character and advance the stream
589589
pub fn next(&mut self) -> Option<char> {
590590
match self.peekable.next() {

0 commit comments

Comments
 (0)