@@ -173,24 +173,19 @@ pub struct CreateTableOp {
173173impl CreateTableOp {
174174 /// Builds a `CreateTableOp` from a `#[derive(Table)]` struct
175175 /// using the given dialect for Rust-to-SQL type mapping.
176- pub fn from_table < T : TableSchema > (
177- dialect : & impl RustTypeMapping ,
178- ) -> Self {
176+ pub fn from_table < T : TableSchema > ( dialect : & impl RustTypeMapping ) -> Self {
179177 let columns = T :: SCHEMA
180178 . iter ( )
181179 . map ( |col| {
182180 let inner = strip_option ( col. rust_type ) ;
183181 let data_type = dialect. map_type ( inner) ;
184- let mut def =
185- ColumnDefinition :: new ( col. name , data_type) ;
182+ let mut def = ColumnDefinition :: new ( col. name , data_type) ;
186183 def. nullable = col. nullable ;
187184 def. primary_key = col. primary_key ;
188185 def. unique = col. unique ;
189186 def. autoincrement = col. autoincrement ;
190187 if let Some ( expr) = col. default_expr {
191- def. default = Some (
192- DefaultValue :: Expression ( expr. to_string ( ) ) ,
193- ) ;
188+ def. default = Some ( DefaultValue :: Expression ( expr. to_string ( ) ) ) ;
194189 }
195190 def
196191 } )
@@ -204,9 +199,7 @@ impl CreateTableOp {
204199 }
205200
206201 /// Same as `from_table` but with `IF NOT EXISTS`.
207- pub fn from_table_if_not_exists < T : TableSchema > (
208- dialect : & impl RustTypeMapping ,
209- ) -> Self {
202+ pub fn from_table_if_not_exists < T : TableSchema > ( dialect : & impl RustTypeMapping ) -> Self {
210203 let mut op = Self :: from_table :: < T > ( dialect) ;
211204 op. if_not_exists = true ;
212205 op
@@ -493,7 +486,7 @@ impl From<RawSqlOp> for Operation {
493486#[ cfg( test) ]
494487mod tests {
495488 use super :: * ;
496- use crate :: migrations:: column_builder:: { bigint , varchar , ForeignKeyAction } ;
489+ use crate :: migrations:: column_builder:: { ForeignKeyAction , bigint , varchar } ;
497490
498491 #[ test]
499492 fn test_drop_table_operation ( ) {
0 commit comments