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