Skip to content

Commit 70228f4

Browse files
committed
Cargo fmt
1 parent b20134f commit 70228f4

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

src/parser/merge.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ use alloc::{boxed::Box, format, string::ToString, vec, vec::Vec};
1717

1818
use crate::{
1919
ast::{
20-
Merge, MergeAction, MergeClause, MergeClauseKind, MergeInsertExpr, MergeInsertKind, MergeUpdateExpr, ObjectName, ObjectNamePart, OutputClause, SetExpr, Statement
20+
Merge, MergeAction, MergeClause, MergeClauseKind, MergeInsertExpr, MergeInsertKind,
21+
MergeUpdateExpr, ObjectName, ObjectNamePart, OutputClause, SetExpr, Statement,
2122
},
2223
dialect::{BigQueryDialect, GenericDialect, MySqlDialect},
2324
keywords::Keyword,
@@ -211,7 +212,10 @@ impl Parser<'_> {
211212
Ok(clauses)
212213
}
213214

214-
fn parse_merge_clause_insert_columns(&mut self, allow_empty: bool) -> Result<Vec<ObjectName>, ParserError> {
215+
fn parse_merge_clause_insert_columns(
216+
&mut self,
217+
allow_empty: bool,
218+
) -> Result<Vec<ObjectName>, ParserError> {
215219
if self.dialect.supports_merge_insert_qualified_columns() {
216220
self.parse_parenthesized_qualified_column_list(IsOptional::Optional, allow_empty)
217221
} else {
@@ -228,7 +232,8 @@ impl Parser<'_> {
228232
allow_empty: bool,
229233
) -> Result<Vec<ObjectName>, ParserError> {
230234
self.parse_parenthesized_column_list_inner(optional, allow_empty, |p| {
231-
p.parse_identifier().map(|ident| ObjectName(vec![ObjectNamePart::Identifier(ident)]))
235+
p.parse_identifier()
236+
.map(|ident| ObjectName(vec![ObjectNamePart::Identifier(ident)]))
232237
})
233238
}
234239

tests/sqlparser_bigquery.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,10 @@ fn parse_merge() {
19261926
predicate: Some(Expr::value(number("1"))),
19271927
action: MergeAction::Insert(MergeInsertExpr {
19281928
insert_token: AttachedToken::empty(),
1929-
columns: vec![Ident::new("product").into(), Ident::new("quantity").into(),],
1929+
columns: vec![
1930+
Ident::new("product").into(),
1931+
Ident::new("quantity").into(),
1932+
],
19301933
kind_token: AttachedToken::empty(),
19311934
kind: MergeInsertKind::Row,
19321935
insert_predicate: None,
@@ -1938,7 +1941,10 @@ fn parse_merge() {
19381941
predicate: None,
19391942
action: MergeAction::Insert(MergeInsertExpr {
19401943
insert_token: AttachedToken::empty(),
1941-
columns: vec![Ident::new("product").into(), Ident::new("quantity").into(),],
1944+
columns: vec![
1945+
Ident::new("product").into(),
1946+
Ident::new("quantity").into(),
1947+
],
19421948
kind_token: AttachedToken::empty(),
19431949
kind: MergeInsertKind::Row,
19441950
insert_predicate: None,

tests/sqlparser_common.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9934,7 +9934,11 @@ fn parse_merge() {
99349934
predicate: None,
99359935
action: MergeAction::Insert(MergeInsertExpr {
99369936
insert_token: AttachedToken::empty(),
9937-
columns: vec![Ident::new("A").into(), Ident::new("B").into(), Ident::new("C").into()],
9937+
columns: vec![
9938+
Ident::new("A").into(),
9939+
Ident::new("B").into(),
9940+
Ident::new("C").into()
9941+
],
99389942
kind_token: AttachedToken::empty(),
99399943
kind: MergeInsertKind::Values(Values {
99409944
value_keyword: false,

0 commit comments

Comments
 (0)