File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
src/tools/rustfmt/src/config Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -155,9 +155,11 @@ pub enum ReportTactic {
155155
156156/// What Rustfmt should emit. Mostly corresponds to the `--emit` command line
157157/// option.
158+ #[ derive( Default ) ]
158159#[ config_type]
159160pub enum EmitMode {
160161 /// Emits to files.
162+ #[ default]
161163 Files ,
162164 /// Writes the output to stdout.
163165 Stdout ,
@@ -310,12 +312,6 @@ impl ::std::str::FromStr for WidthHeuristics {
310312 }
311313}
312314
313- impl Default for EmitMode {
314- fn default ( ) -> EmitMode {
315- EmitMode :: Files
316- }
317- }
318-
319315/// A set of directories, files and modules that rustfmt should ignore.
320316#[ derive( Default , Clone , Debug , PartialEq ) ]
321317pub struct IgnoreList {
@@ -425,10 +421,12 @@ pub trait CliOptions {
425421}
426422
427423/// The edition of the syntax and semantics of code (RFC 2052).
424+ #[ derive( Default ) ]
428425#[ config_type]
429426pub enum Edition {
430427 #[ value = "2015" ]
431428 #[ doc_hint = "2015" ]
429+ #[ default]
432430 /// Edition 2015.
433431 Edition2015 ,
434432 #[ value = "2018" ]
@@ -445,12 +443,6 @@ pub enum Edition {
445443 Edition2024 ,
446444}
447445
448- impl Default for Edition {
449- fn default ( ) -> Edition {
450- Edition :: Edition2015
451- }
452- }
453-
454446impl From < Edition > for rustc_span:: edition:: Edition {
455447 fn from ( edition : Edition ) -> Self {
456448 match edition {
You can’t perform that action at this time.
0 commit comments