Skip to content

Commit f125b1f

Browse files
committed
Fix clippy warnings on rust 1.83
1 parent d774caf commit f125b1f

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
@@ -1123,15 +1123,18 @@ pub enum ColumnOption {
11231123
/// `DEFAULT <restricted-expr>`
11241124
Default(Expr),
11251125

1126-
/// ClickHouse supports `MATERIALIZE`, `EPHEMERAL` and `ALIAS` expr to generate default values.
1126+
/// `MATERIALIZE <expr>`
11271127
/// Syntax: `b INT MATERIALIZE (a + 1)`
1128+
///
11281129
/// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/create/table#default_values)
1129-
1130-
/// `MATERIALIZE <expr>`
11311130
Materialized(Expr),
11321131
/// `EPHEMERAL [<expr>]`
1132+
///
1133+
/// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/create/table#default_values)
11331134
Ephemeral(Option<Expr>),
11341135
/// `ALIAS <expr>`
1136+
///
1137+
/// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/create/table#default_values)
11351138
Alias(Expr),
11361139

11371140
/// `{ PRIMARY KEY | UNIQUE } [<constraint_characteristics>]`
@@ -1330,7 +1333,7 @@ pub enum GeneratedExpressionMode {
13301333
#[must_use]
13311334
fn display_constraint_name(name: &'_ Option<Ident>) -> impl fmt::Display + '_ {
13321335
struct ConstraintName<'a>(&'a Option<Ident>);
1333-
impl<'a> fmt::Display for ConstraintName<'a> {
1336+
impl fmt::Display for ConstraintName<'_> {
13341337
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
13351338
if let Some(name) = self.0 {
13361339
write!(f, "CONSTRAINT {name} ")?;
@@ -1351,7 +1354,7 @@ fn display_option<'a, T: fmt::Display>(
13511354
option: &'a Option<T>,
13521355
) -> impl fmt::Display + 'a {
13531356
struct OptionDisplay<'a, T>(&'a str, &'a str, &'a Option<T>);
1354-
impl<'a, T: fmt::Display> fmt::Display for OptionDisplay<'a, T> {
1357+
impl<T: fmt::Display> fmt::Display for OptionDisplay<'_, T> {
13551358
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
13561359
if let Some(inner) = self.2 {
13571360
let (prefix, postfix) = (self.0, self.1);

src/ast/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ where
9999
sep: &'static str,
100100
}
101101

102-
impl<'a, T> fmt::Display for DisplaySeparated<'a, T>
102+
impl<T> fmt::Display for DisplaySeparated<'_, T>
103103
where
104104
T: fmt::Display,
105105
{

src/ast/query.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,7 @@ impl fmt::Display for Join {
15971597
}
15981598
fn suffix(constraint: &'_ JoinConstraint) -> impl fmt::Display + '_ {
15991599
struct Suffix<'a>(&'a JoinConstraint);
1600-
impl<'a> fmt::Display for Suffix<'a> {
1600+
impl fmt::Display for Suffix<'_> {
16011601
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
16021602
match self.0 {
16031603
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
@@ -10458,13 +10458,12 @@ impl<'a> Parser<'a> {
1045810458
Ok(ExprWithAlias { expr, alias })
1045910459
}
1046010460
/// Parses an expression with an optional alias
10461-
10461+
///
1046210462
/// Examples:
10463-
10463+
///
1046410464
/// ```sql
1046510465
/// SUM(price) AS total_price
1046610466
/// ```
10467-
1046810467
/// ```sql
1046910468
/// SUM(price)
1047010469
/// ```
@@ -10480,7 +10479,6 @@ impl<'a> Parser<'a> {
1048010479
/// assert_eq!(Some("b".to_string()), expr_with_alias.alias.map(|x|x.value));
1048110480
/// # Ok(())
1048210481
/// # }
10483-
1048410482
pub fn parse_expr_with_alias(&mut self) -> Result<ExprWithAlias, ParserError> {
1048510483
let expr = self.parse_expr()?;
1048610484
let alias = if self.parse_keyword(Keyword::AS) {

src/tokenizer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ struct State<'a> {
504504
pub col: u64,
505505
}
506506

507-
impl<'a> State<'a> {
507+
impl State<'_> {
508508
/// return the next character and advance the stream
509509
pub fn next(&mut self) -> Option<char> {
510510
match self.peekable.next() {

0 commit comments

Comments
 (0)