File tree 1 file changed +4
-12
lines changed
src/tools/rustfmt/src/config
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -155,9 +155,11 @@ pub enum ReportTactic {
155
155
156
156
/// What Rustfmt should emit. Mostly corresponds to the `--emit` command line
157
157
/// option.
158
+ #[ derive( Default ) ]
158
159
#[ config_type]
159
160
pub enum EmitMode {
160
161
/// Emits to files.
162
+ #[ default]
161
163
Files ,
162
164
/// Writes the output to stdout.
163
165
Stdout ,
@@ -310,12 +312,6 @@ impl ::std::str::FromStr for WidthHeuristics {
310
312
}
311
313
}
312
314
313
- impl Default for EmitMode {
314
- fn default ( ) -> EmitMode {
315
- EmitMode :: Files
316
- }
317
- }
318
-
319
315
/// A set of directories, files and modules that rustfmt should ignore.
320
316
#[ derive( Default , Clone , Debug , PartialEq ) ]
321
317
pub struct IgnoreList {
@@ -425,10 +421,12 @@ pub trait CliOptions {
425
421
}
426
422
427
423
/// The edition of the syntax and semantics of code (RFC 2052).
424
+ #[ derive( Default ) ]
428
425
#[ config_type]
429
426
pub enum Edition {
430
427
#[ value = "2015" ]
431
428
#[ doc_hint = "2015" ]
429
+ #[ default]
432
430
/// Edition 2015.
433
431
Edition2015 ,
434
432
#[ value = "2018" ]
@@ -445,12 +443,6 @@ pub enum Edition {
445
443
Edition2024 ,
446
444
}
447
445
448
- impl Default for Edition {
449
- fn default ( ) -> Edition {
450
- Edition :: Edition2015
451
- }
452
- }
453
-
454
446
impl From < Edition > for rustc_span:: edition:: Edition {
455
447
fn from ( edition : Edition ) -> Self {
456
448
match edition {
You can’t perform that action at this time.
0 commit comments