@@ -117,7 +117,7 @@ impl fmt::Display for AlterTableOperation {
117
117
display_comma_separated( new_partitions) ,
118
118
ine = if * if_not_exists { " IF NOT EXISTS" } else { "" }
119
119
) ,
120
- AlterTableOperation :: AddConstraint ( c) => write ! ( f, "ADD {}" , c ) ,
120
+ AlterTableOperation :: AddConstraint ( c) => write ! ( f, "ADD {c}" ) ,
121
121
AlterTableOperation :: AddColumn {
122
122
column_keyword,
123
123
if_not_exists,
@@ -135,7 +135,7 @@ impl fmt::Display for AlterTableOperation {
135
135
Ok ( ( ) )
136
136
}
137
137
AlterTableOperation :: AlterColumn { column_name, op } => {
138
- write ! ( f, "ALTER COLUMN {} {}" , column_name , op )
138
+ write ! ( f, "ALTER COLUMN {column_name } {op}" )
139
139
}
140
140
AlterTableOperation :: DropPartitions {
141
141
partitions,
@@ -183,29 +183,25 @@ impl fmt::Display for AlterTableOperation {
183
183
AlterTableOperation :: RenameColumn {
184
184
old_column_name,
185
185
new_column_name,
186
- } => write ! (
187
- f,
188
- "RENAME COLUMN {} TO {}" ,
189
- old_column_name, new_column_name
190
- ) ,
186
+ } => write ! ( f, "RENAME COLUMN {old_column_name} TO {new_column_name}" ) ,
191
187
AlterTableOperation :: RenameTable { table_name } => {
192
- write ! ( f, "RENAME TO {}" , table_name )
188
+ write ! ( f, "RENAME TO {table_name}" )
193
189
}
194
190
AlterTableOperation :: ChangeColumn {
195
191
old_name,
196
192
new_name,
197
193
data_type,
198
194
options,
199
195
} => {
200
- write ! ( f, "CHANGE COLUMN {} {} {}" , old_name , new_name , data_type ) ?;
196
+ write ! ( f, "CHANGE COLUMN {old_name } {new_name } {data_type}" ) ?;
201
197
if options. is_empty ( ) {
202
198
Ok ( ( ) )
203
199
} else {
204
200
write ! ( f, " {}" , display_separated( options, " " ) )
205
201
}
206
202
}
207
203
AlterTableOperation :: RenameConstraint { old_name, new_name } => {
208
- write ! ( f, "RENAME CONSTRAINT {} TO {}" , old_name , new_name )
204
+ write ! ( f, "RENAME CONSTRAINT {old_name } TO {new_name}" )
209
205
}
210
206
}
211
207
}
@@ -215,7 +211,7 @@ impl fmt::Display for AlterIndexOperation {
215
211
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
216
212
match self {
217
213
AlterIndexOperation :: RenameIndex { index_name } => {
218
- write ! ( f, "RENAME TO {}" , index_name )
214
+ write ! ( f, "RENAME TO {index_name}" )
219
215
}
220
216
}
221
217
}
@@ -248,16 +244,16 @@ impl fmt::Display for AlterColumnOperation {
248
244
AlterColumnOperation :: SetNotNull => write ! ( f, "SET NOT NULL" , ) ,
249
245
AlterColumnOperation :: DropNotNull => write ! ( f, "DROP NOT NULL" , ) ,
250
246
AlterColumnOperation :: SetDefault { value } => {
251
- write ! ( f, "SET DEFAULT {}" , value )
247
+ write ! ( f, "SET DEFAULT {value}" )
252
248
}
253
249
AlterColumnOperation :: DropDefault { } => {
254
250
write ! ( f, "DROP DEFAULT" )
255
251
}
256
252
AlterColumnOperation :: SetDataType { data_type, using } => {
257
253
if let Some ( expr) = using {
258
- write ! ( f, "SET DATA TYPE {} USING {}" , data_type , expr )
254
+ write ! ( f, "SET DATA TYPE {data_type } USING {expr}" )
259
255
} else {
260
- write ! ( f, "SET DATA TYPE {}" , data_type )
256
+ write ! ( f, "SET DATA TYPE {data_type}" )
261
257
}
262
258
}
263
259
}
@@ -369,10 +365,10 @@ impl fmt::Display for TableConstraint {
369
365
display_comma_separated( referred_columns) ,
370
366
) ?;
371
367
if let Some ( action) = on_delete {
372
- write ! ( f, " ON DELETE {}" , action ) ?;
368
+ write ! ( f, " ON DELETE {action}" ) ?;
373
369
}
374
370
if let Some ( action) = on_update {
375
- write ! ( f, " ON UPDATE {}" , action ) ?;
371
+ write ! ( f, " ON UPDATE {action}" ) ?;
376
372
}
377
373
Ok ( ( ) )
378
374
}
@@ -387,10 +383,10 @@ impl fmt::Display for TableConstraint {
387
383
} => {
388
384
write ! ( f, "{}" , if * display_as_key { "KEY" } else { "INDEX" } ) ?;
389
385
if let Some ( name) = name {
390
- write ! ( f, " {}" , name ) ?;
386
+ write ! ( f, " {name}" ) ?;
391
387
}
392
388
if let Some ( index_type) = index_type {
393
- write ! ( f, " USING {}" , index_type ) ?;
389
+ write ! ( f, " USING {index_type}" ) ?;
394
390
}
395
391
write ! ( f, " ({})" , display_comma_separated( columns) ) ?;
396
392
@@ -409,11 +405,11 @@ impl fmt::Display for TableConstraint {
409
405
}
410
406
411
407
if !matches ! ( index_type_display, KeyOrIndexDisplay :: None ) {
412
- write ! ( f, " {}" , index_type_display ) ?;
408
+ write ! ( f, " {index_type_display}" ) ?;
413
409
}
414
410
415
411
if let Some ( name) = opt_index_name {
416
- write ! ( f, " {}" , name ) ?;
412
+ write ! ( f, " {name}" ) ?;
417
413
}
418
414
419
415
write ! ( f, " ({})" , display_comma_separated( columns) ) ?;
@@ -500,7 +496,7 @@ impl fmt::Display for ColumnDef {
500
496
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
501
497
write ! ( f, "{} {}" , self . name, self . data_type) ?;
502
498
for option in & self . options {
503
- write ! ( f, " {}" , option ) ?;
499
+ write ! ( f, " {option}" ) ?;
504
500
}
505
501
Ok ( ( ) )
506
502
}
@@ -580,7 +576,7 @@ impl fmt::Display for ColumnOption {
580
576
match self {
581
577
Null => write ! ( f, "NULL" ) ,
582
578
NotNull => write ! ( f, "NOT NULL" ) ,
583
- Default ( expr) => write ! ( f, "DEFAULT {}" , expr ) ,
579
+ Default ( expr) => write ! ( f, "DEFAULT {expr}" ) ,
584
580
Unique { is_primary } => {
585
581
write ! ( f, "{}" , if * is_primary { "PRIMARY KEY" } else { "UNIQUE" } )
586
582
}
@@ -590,23 +586,23 @@ impl fmt::Display for ColumnOption {
590
586
on_delete,
591
587
on_update,
592
588
} => {
593
- write ! ( f, "REFERENCES {}" , foreign_table ) ?;
589
+ write ! ( f, "REFERENCES {foreign_table}" ) ?;
594
590
if !referred_columns. is_empty ( ) {
595
591
write ! ( f, " ({})" , display_comma_separated( referred_columns) ) ?;
596
592
}
597
593
if let Some ( action) = on_delete {
598
- write ! ( f, " ON DELETE {}" , action ) ?;
594
+ write ! ( f, " ON DELETE {action}" ) ?;
599
595
}
600
596
if let Some ( action) = on_update {
601
- write ! ( f, " ON UPDATE {}" , action ) ?;
597
+ write ! ( f, " ON UPDATE {action}" ) ?;
602
598
}
603
599
Ok ( ( ) )
604
600
}
605
- Check ( expr) => write ! ( f, "CHECK ({})" , expr ) ,
601
+ Check ( expr) => write ! ( f, "CHECK ({expr })" ) ,
606
602
DialectSpecific ( val) => write ! ( f, "{}" , display_separated( val, " " ) ) ,
607
- CharacterSet ( n) => write ! ( f, "CHARACTER SET {}" , n ) ,
603
+ CharacterSet ( n) => write ! ( f, "CHARACTER SET {n}" ) ,
608
604
Comment ( v) => write ! ( f, "COMMENT '{}'" , escape_single_quote_string( v) ) ,
609
- OnUpdate ( expr) => write ! ( f, "ON UPDATE {}" , expr ) ,
605
+ OnUpdate ( expr) => write ! ( f, "ON UPDATE {expr}" ) ,
610
606
}
611
607
}
612
608
}
@@ -616,7 +612,7 @@ fn display_constraint_name(name: &'_ Option<Ident>) -> impl fmt::Display + '_ {
616
612
impl < ' a > fmt:: Display for ConstraintName < ' a > {
617
613
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
618
614
if let Some ( name) = self . 0 {
619
- write ! ( f, "CONSTRAINT {} " , name ) ?;
615
+ write ! ( f, "CONSTRAINT {name } " ) ?;
620
616
}
621
617
Ok ( ( ) )
622
618
}
0 commit comments