Skip to content

Commit a847e44

Browse files
authored
Fix clippy lint on rust 1.86 (#1796)
1 parent 7efa686 commit a847e44

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

src/ast/ddl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ impl fmt::Display for AlterColumnOperation {
868868
AlterColumnOperation::SetDefault { value } => {
869869
write!(f, "SET DEFAULT {value}")
870870
}
871-
AlterColumnOperation::DropDefault {} => {
871+
AlterColumnOperation::DropDefault => {
872872
write!(f, "DROP DEFAULT")
873873
}
874874
AlterColumnOperation::SetDataType { data_type, using } => {

src/ast/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -662,17 +662,17 @@ pub enum Expr {
662662
/// such as maps, arrays, and lists:
663663
/// - Array
664664
/// - A 1-dim array `a[1]` will be represented like:
665-
/// `CompoundFieldAccess(Ident('a'), vec![Subscript(1)]`
665+
/// `CompoundFieldAccess(Ident('a'), vec![Subscript(1)]`
666666
/// - A 2-dim array `a[1][2]` will be represented like:
667-
/// `CompoundFieldAccess(Ident('a'), vec![Subscript(1), Subscript(2)]`
667+
/// `CompoundFieldAccess(Ident('a'), vec![Subscript(1), Subscript(2)]`
668668
/// - Map or Struct (Bracket-style)
669669
/// - A map `a['field1']` will be represented like:
670-
/// `CompoundFieldAccess(Ident('a'), vec![Subscript('field')]`
670+
/// `CompoundFieldAccess(Ident('a'), vec![Subscript('field')]`
671671
/// - A 2-dim map `a['field1']['field2']` will be represented like:
672-
/// `CompoundFieldAccess(Ident('a'), vec![Subscript('field1'), Subscript('field2')]`
672+
/// `CompoundFieldAccess(Ident('a'), vec![Subscript('field1'), Subscript('field2')]`
673673
/// - Struct (Dot-style) (only effect when the chain contains both subscript and expr)
674674
/// - A struct access `a[field1].field2` will be represented like:
675-
/// `CompoundFieldAccess(Ident('a'), vec![Subscript('field1'), Ident('field2')]`
675+
/// `CompoundFieldAccess(Ident('a'), vec![Subscript('field1'), Ident('field2')]`
676676
/// - If a struct access likes `a.field1.field2`, it will be represented by CompoundIdentifier([a, field1, field2])
677677
CompoundFieldAccess {
678678
root: Box<Expr>,
@@ -7617,7 +7617,7 @@ impl fmt::Display for CopyTarget {
76177617
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
76187618
use CopyTarget::*;
76197619
match self {
7620-
Stdin { .. } => write!(f, "STDIN"),
7620+
Stdin => write!(f, "STDIN"),
76217621
Stdout => write!(f, "STDOUT"),
76227622
File { filename } => write!(f, "'{}'", value::escape_single_quote_string(filename)),
76237623
Program { command } => write!(

src/dialect/snowflake.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -1038,14 +1038,13 @@ fn parse_session_options(
10381038
}
10391039
}
10401040
}
1041-
options
1042-
.is_empty()
1043-
.then(|| {
1044-
Err(ParserError::ParserError(
1045-
"expected at least one option".to_string(),
1046-
))
1047-
})
1048-
.unwrap_or(Ok(options))
1041+
if options.is_empty() {
1042+
Err(ParserError::ParserError(
1043+
"expected at least one option".to_string(),
1044+
))
1045+
} else {
1046+
Ok(options)
1047+
}
10491048
}
10501049

10511050
/// Parses options provided within parentheses like:

src/keywords.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
//! This module defines
1919
//! 1) a list of constants for every keyword
2020
//! 2) an `ALL_KEYWORDS` array with every keyword in it
21-
//! This is not a list of *reserved* keywords: some of these can be
22-
//! parsed as identifiers if the parser decides so. This means that
23-
//! new keywords can be added here without affecting the parse result.
21+
//! This is not a list of *reserved* keywords: some of these can be
22+
//! parsed as identifiers if the parser decides so. This means that
23+
//! new keywords can be added here without affecting the parse result.
2424
//!
25-
//! As a matter of fact, most of these keywords are not used at all
26-
//! and could be removed.
25+
//! As a matter of fact, most of these keywords are not used at all
26+
//! and could be removed.
2727
//! 3) a `RESERVED_FOR_TABLE_ALIAS` array with keywords reserved in a
28-
//! "table alias" context.
28+
//! "table alias" context.
2929
3030
#[cfg(feature = "serde")]
3131
use serde::{Deserialize, Serialize};

tests/sqlparser_common.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -14091,8 +14091,7 @@ fn test_table_sample() {
1409114091

1409214092
#[test]
1409314093
fn overflow() {
14094-
let expr = std::iter::repeat("1")
14095-
.take(1000)
14094+
let expr = std::iter::repeat_n("1", 1000)
1409614095
.collect::<Vec<_>>()
1409714096
.join(" + ");
1409814097
let sql = format!("SELECT {}", expr);

0 commit comments

Comments
 (0)