Skip to content

Commit eaa09d3

Browse files
Box Expr to avoid large variant clippy warning
1 parent 4154975 commit eaa09d3

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
@@ -7757,7 +7757,7 @@ impl<'a> Parser<'a> {
77577757
} else if self.parse_keyword(Keyword::SRID)
77587758
&& dialect_of!(self is MySqlDialect | GenericDialect)
77597759
{
7760-
Ok(Some(ColumnOption::Srid(self.parse_expr()?)))
7760+
Ok(Some(ColumnOption::Srid(Box::new(self.parse_expr()?))))
77617761
} else if self.parse_keyword(Keyword::IDENTITY)
77627762
&& dialect_of!(self is MsSqlDialect | GenericDialect)
77637763
{
@@ -16590,7 +16590,10 @@ mod tests {
1659016590
if let Statement::CreateTable(v) = &ast[0] {
1659116591
assert_eq!(
1659216592
v.columns[0].options[0].option,
16593-
ColumnOption::Srid(Expr::value(Value::Number("4326".parse().unwrap(), false)))
16593+
ColumnOption::Srid(Box::new(Expr::value(Value::Number(
16594+
"4326".parse().unwrap(),
16595+
false
16596+
))))
1659416597
);
1659516598
}
1659616599
}

0 commit comments

Comments
 (0)