Skip to content

Commit e02fc5c

Browse files
Box Expr to avoid large variant clippy warning
1 parent 8783f09 commit e02fc5c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/ast/ddl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,7 @@ pub enum ColumnOption {
17641764
/// CREATE TABLE geom (g GEOMETRY NOT NULL SRID 4326);
17651765
/// ```
17661766
/// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/creating-spatial-indexes.html
1767-
Srid(Expr),
1767+
Srid(Box<Expr>),
17681768
}
17691769

17701770
impl fmt::Display for ColumnOption {

src/parser/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7751,7 +7751,7 @@ impl<'a> Parser<'a> {
77517751
} else if self.parse_keyword(Keyword::SRID)
77527752
&& dialect_of!(self is MySqlDialect | GenericDialect)
77537753
{
7754-
Ok(Some(ColumnOption::Srid(self.parse_expr()?)))
7754+
Ok(Some(ColumnOption::Srid(Box::new(self.parse_expr()?))))
77557755
} else if self.parse_keyword(Keyword::IDENTITY)
77567756
&& dialect_of!(self is MsSqlDialect | GenericDialect)
77577757
{
@@ -16584,7 +16584,10 @@ mod tests {
1658416584
if let Statement::CreateTable(v) = &ast[0] {
1658516585
assert_eq!(
1658616586
v.columns[0].options[0].option,
16587-
ColumnOption::Srid(Expr::value(Value::Number("4326".parse().unwrap(), false)))
16587+
ColumnOption::Srid(Box::new(Expr::value(Value::Number(
16588+
"4326".parse().unwrap(),
16589+
false
16590+
))))
1658816591
);
1658916592
}
1659016593
}

0 commit comments

Comments
 (0)