Skip to content

Commit 95c46f1

Browse files
committed
Fix lint failures #2078
1 parent b9a400c commit 95c46f1

File tree

2 files changed

+11
-20
lines changed

2 files changed

+11
-20
lines changed

src/ast/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,10 +2787,11 @@ impl fmt::Display for Declare {
27872787
}
27882788

27892789
/// Sql options of a `CREATE TABLE` statement.
2790-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
2790+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
27912791
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27922792
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
27932793
pub enum CreateTableOptions {
2794+
#[default]
27942795
None,
27952796
/// Options specified using the `WITH` keyword.
27962797
/// e.g. `WITH (description = "123")`
@@ -2819,12 +2820,6 @@ pub enum CreateTableOptions {
28192820
TableProperties(Vec<SqlOption>),
28202821
}
28212822

2822-
impl Default for CreateTableOptions {
2823-
fn default() -> Self {
2824-
Self::None
2825-
}
2826-
}
2827-
28282823
impl fmt::Display for CreateTableOptions {
28292824
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
28302825
match self {

tests/sqlparser_common.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17636,22 +17636,18 @@ fn parse_generic_unary_ops() {
1763617636
#[test]
1763717637
fn parse_reset_statement() {
1763817638
match verified_stmt("RESET some_parameter") {
17639-
Statement::Reset(ResetStatement { reset }) => match reset {
17640-
Reset::ConfigurationParameter(o) => {
17641-
assert_eq!(o, ObjectName::from(vec!["some_parameter".into()]))
17642-
}
17643-
_ => unreachable!(),
17644-
},
17639+
Statement::Reset(ResetStatement {
17640+
reset: Reset::ConfigurationParameter(o),
17641+
}) => assert_eq!(o, ObjectName::from(vec!["some_parameter".into()])),
1764517642
_ => unreachable!(),
1764617643
}
1764717644
match verified_stmt("RESET some_extension.some_parameter") {
17648-
Statement::Reset(ResetStatement { reset }) => match reset {
17649-
Reset::ConfigurationParameter(o) => assert_eq!(
17650-
o,
17651-
ObjectName::from(vec!["some_extension".into(), "some_parameter".into()])
17652-
),
17653-
_ => unreachable!(),
17654-
},
17645+
Statement::Reset(ResetStatement {
17646+
reset: Reset::ConfigurationParameter(o),
17647+
}) => assert_eq!(
17648+
o,
17649+
ObjectName::from(vec!["some_extension".into(), "some_parameter".into()])
17650+
),
1765517651
_ => unreachable!(),
1765617652
}
1765717653
match verified_stmt("RESET ALL") {

0 commit comments

Comments
 (0)