Skip to content

Commit 3edc55b

Browse files
committed
Apply cargo fmt
1 parent 15ede2f commit 3edc55b

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

src/ast/ddl.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ use serde::{Deserialize, Serialize};
2424
use sqlparser_derive::{Visit, VisitMut};
2525

2626
use crate::ast::value::escape_single_quote_string;
27-
use crate::ast::{display_comma_separated, display_separated, DataType, Expr, Ident, MySQLColumnPosition, ObjectName, SequenceOptions, SqlOption};
27+
use crate::ast::{
28+
display_comma_separated, display_separated, DataType, Expr, Ident, MySQLColumnPosition,
29+
ObjectName, SequenceOptions, SqlOption,
30+
};
2831
use crate::tokenizer::Token;
2932

3033
/// An `ALTER TABLE` (`Statement::AlterTable`) operation

src/ast/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ pub use self::dcl::{AlterRoleOperation, ResetConfig, RoleOption, SetConfigValue}
3434
pub use self::ddl::{
3535
AlterColumnOperation, AlterIndexOperation, AlterTableOperation, ColumnDef, ColumnOption,
3636
ColumnOptionDef, ConstraintCharacteristics, DeferrableInitial, GeneratedAs,
37-
GeneratedExpressionMode, IndexOption, IndexType, KeyOrIndexDisplay, Owner, Partition, ProcedureParam,
38-
ReferentialAction, TableConstraint, UserDefinedTypeCompositeAttributeDef,
37+
GeneratedExpressionMode, IndexOption, IndexType, KeyOrIndexDisplay, Owner, Partition,
38+
ProcedureParam, ReferentialAction, TableConstraint, UserDefinedTypeCompositeAttributeDef,
3939
UserDefinedTypeRepresentation, ViewColumnDef,
4040
};
4141
pub use self::dml::{Delete, Insert};

src/parser/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -6272,7 +6272,9 @@ impl<'a> Parser<'a> {
62726272
self.expect_keyword(Keyword::WITH)?;
62736273
let table_name = self.parse_object_name(false)?;
62746274
AlterTableOperation::SwapWith { table_name }
6275-
} else if dialect_of!(self is PostgreSqlDialect) && self.parse_keywords(&[Keyword::OWNER, Keyword::TO]) {
6275+
} else if dialect_of!(self is PostgreSqlDialect)
6276+
&& self.parse_keywords(&[Keyword::OWNER, Keyword::TO])
6277+
{
62766278
let next_token = self.next_token();
62776279
let new_owner = match next_token.token {
62786280
Token::DoubleQuotedString(ref s) => Owner::Ident(Ident::new(s.to_string())),

tests/sqlparser_postgres.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,12 @@ fn parse_alter_table_owner_to() {
774774
location: _,
775775
} => {
776776
assert_eq!(name.to_string(), "tab");
777-
assert_eq!(operations, vec![AlterTableOperation::OwnerTo { new_owner: case.expected_owner.clone() }]);
777+
assert_eq!(
778+
operations,
779+
vec![AlterTableOperation::OwnerTo {
780+
new_owner: case.expected_owner.clone()
781+
}]
782+
);
778783
}
779784
_ => unreachable!("Expected an AlterTable statement"),
780785
}

0 commit comments

Comments
 (0)