Skip to content

Commit 6076c2d

Browse files
committed
Apply cargo fmt
1 parent 52c162d commit 6076c2d

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

src/ast/ddl.rs

Lines changed: 4 additions & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6274,7 +6274,9 @@ impl<'a> Parser<'a> {
62746274
self.expect_keyword(Keyword::WITH)?;
62756275
let table_name = self.parse_object_name(false)?;
62766276
AlterTableOperation::SwapWith { table_name }
6277-
} else if dialect_of!(self is PostgreSqlDialect) && self.parse_keywords(&[Keyword::OWNER, Keyword::TO]) {
6277+
} else if dialect_of!(self is PostgreSqlDialect)
6278+
&& self.parse_keywords(&[Keyword::OWNER, Keyword::TO])
6279+
{
62786280
let next_token = self.next_token();
62796281
let new_owner = match next_token.token {
62806282
Token::DoubleQuotedString(ref s) => Owner::Ident(Ident::new(s.to_string())),

tests/sqlparser_postgres.rs

Lines changed: 6 additions & 1 deletion
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)