Skip to content

Commit 03d40eb

Browse files
committed
Cargo fmt
1 parent 93bd2ad commit 03d40eb

6 files changed

Lines changed: 34 additions & 6 deletions

File tree

src/ast/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl<T> Deref for Parens<T> {
234234
}
235235
}
236236

237-
impl <T> DerefMut for Parens<T> {
237+
impl<T> DerefMut for Parens<T> {
238238
fn deref_mut(&mut self) -> &mut Self::Target {
239239
&mut self.content
240240
}

src/ast/spans.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,26 @@ use core::iter;
2828
use crate::tokenizer::Span;
2929

3030
use super::{
31-
AccessExpr, AlterColumnOperation, AlterIndexOperation, AlterTableOperation, Analyze, Array, Assignment, AssignmentTarget, AttachedToken, BeginEndStatements, CaseStatement, CloseCursor, ClusteredIndex, ColumnDef, ColumnOption, ColumnOptionDef, ConditionalStatementBlock, ConditionalStatements, ConflictTarget, ConnectByKind, ConstraintCharacteristics, CopySource, CreateIndex, CreateTable, CreateTableOptions, Cte, Delete, DoUpdate, ExceptSelectItem, ExcludeSelectItem, Expr, ExprWithAlias, Fetch, ForValues, FromTable, Function, FunctionArg, FunctionArgExpr, FunctionArgumentClause, FunctionArgumentList, FunctionArguments, GroupByExpr, HavingBound, IfStatement, IlikeSelectItem, IndexColumn, Insert, Interpolate, InterpolateExpr, Join, JoinConstraint, JoinOperator, JsonPath, JsonPathElem, LateralView, LimitClause, MatchRecognizePattern, Measure, Merge, MergeAction, MergeClause, MergeInsertExpr, MergeInsertKind, MergeUpdateExpr, NamedParenthesizedList, NamedWindowDefinition, ObjectName, ObjectNamePart, Offset, OnConflict, OnConflictAction, OnInsert, OpenStatement, OrderBy, OrderByExpr, OrderByKind, OutputClause, Parens, Partition, PartitionBoundValue, PivotValueSource, ProjectionSelect, Query, RaiseStatement, RaiseStatementValue, ReferentialAction, RenameSelectItem, ReplaceSelectElement, ReplaceSelectItem, Select, SelectInto, SelectItem, SetExpr, SqlOption, Statement, Subscript, SymbolDefinition, TableAlias, TableAliasColumnDef, TableConstraint, TableFactor, TableObject, TableOptionsClustered, TableWithJoins, Update, UpdateTableFromKind, Use, Values, ViewColumnDef, WhileStatement, WildcardAdditionalOptions, With, WithFill, comments, dcl::SecondaryRoles, value::ValueWithSpan
31+
comments, dcl::SecondaryRoles, value::ValueWithSpan, AccessExpr, AlterColumnOperation,
32+
AlterIndexOperation, AlterTableOperation, Analyze, Array, Assignment, AssignmentTarget,
33+
AttachedToken, BeginEndStatements, CaseStatement, CloseCursor, ClusteredIndex, ColumnDef,
34+
ColumnOption, ColumnOptionDef, ConditionalStatementBlock, ConditionalStatements,
35+
ConflictTarget, ConnectByKind, ConstraintCharacteristics, CopySource, CreateIndex, CreateTable,
36+
CreateTableOptions, Cte, Delete, DoUpdate, ExceptSelectItem, ExcludeSelectItem, Expr,
37+
ExprWithAlias, Fetch, ForValues, FromTable, Function, FunctionArg, FunctionArgExpr,
38+
FunctionArgumentClause, FunctionArgumentList, FunctionArguments, GroupByExpr, HavingBound,
39+
IfStatement, IlikeSelectItem, IndexColumn, Insert, Interpolate, InterpolateExpr, Join,
40+
JoinConstraint, JoinOperator, JsonPath, JsonPathElem, LateralView, LimitClause,
41+
MatchRecognizePattern, Measure, Merge, MergeAction, MergeClause, MergeInsertExpr,
42+
MergeInsertKind, MergeUpdateExpr, NamedParenthesizedList, NamedWindowDefinition, ObjectName,
43+
ObjectNamePart, Offset, OnConflict, OnConflictAction, OnInsert, OpenStatement, OrderBy,
44+
OrderByExpr, OrderByKind, OutputClause, Parens, Partition, PartitionBoundValue,
45+
PivotValueSource, ProjectionSelect, Query, RaiseStatement, RaiseStatementValue,
46+
ReferentialAction, RenameSelectItem, ReplaceSelectElement, ReplaceSelectItem, Select,
47+
SelectInto, SelectItem, SetExpr, SqlOption, Statement, Subscript, SymbolDefinition, TableAlias,
48+
TableAliasColumnDef, TableConstraint, TableFactor, TableObject, TableOptionsClustered,
49+
TableWithJoins, Update, UpdateTableFromKind, Use, Values, ViewColumnDef, WhileStatement,
50+
WildcardAdditionalOptions, With, WithFill,
3251
};
3352

3453
/// Given an iterator of spans, return the [Span::union] of all spans.

src/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18615,7 +18615,7 @@ impl<'a> Parser<'a> {
1861518615
Ok(Parens {
1861618616
opening_token: opening_paren.into(),
1861718617
content: vec![],
18618-
closing_token: closing_paren.into()
18618+
closing_token: closing_paren.into(),
1861918619
})
1862018620
} else {
1862118621
let exprs = parser.parse_comma_separated(Parser::parse_expr)?;

tests/sqlparser_bigquery.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,10 @@ fn parse_merge() {
18211821
kind: MergeInsertKind::Values(Values {
18221822
value_keyword: false,
18231823
explicit_row: false,
1824-
rows: vec![Parens::with_empty_span(vec![Expr::value(number("1")), Expr::value(number("2"))])],
1824+
rows: vec![Parens::with_empty_span(vec![
1825+
Expr::value(number("1")),
1826+
Expr::value(number("2")),
1827+
])],
18251828
}),
18261829
insert_predicate: None,
18271830
});

tests/sqlparser_common.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ fn parse_insert_values() {
101101
Expr::value(number("3")),
102102
];
103103
let rows1 = vec![Parens::with_empty_span(row.clone())];
104-
let rows2 = vec![Parens::with_empty_span(row.clone()), Parens::with_empty_span(row)];
104+
let rows2 = vec![
105+
Parens::with_empty_span(row.clone()),
106+
Parens::with_empty_span(row),
107+
];
105108

106109
let sql = "INSERT customer VALUES (1, 2, 3)";
107110
check_one(sql, "customer", &[], &rows1, false);

tests/sqlparser_mysql.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,10 @@ fn parse_empty_row_insert() {
23322332
body: Box::new(SetExpr::Values(Values {
23332333
value_keyword: false,
23342334
explicit_row: false,
2335-
rows: vec![Parens::with_empty_span(vec![]), Parens::with_empty_span(vec![])]
2335+
rows: vec![
2336+
Parens::with_empty_span(vec![]),
2337+
Parens::with_empty_span(vec![])
2338+
]
23362339
})),
23372340
order_by: None,
23382341
limit_clause: None,

0 commit comments

Comments
 (0)