Skip to content

Commit f649c4c

Browse files
committed
make style-edition a stable option on the CLI
1 parent ab98945 commit f649c4c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/bin/main.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ fn make_opts() -> Options {
135135
"Rust edition to use",
136136
"[2015|2018|2021|2024]",
137137
);
138+
opts.optopt(
139+
"",
140+
"style-edition",
141+
"The edition of the Style Guide (unstable).",
142+
"[2015|2018|2021|2024]",
143+
);
138144
opts.optopt(
139145
"",
140146
"color",
@@ -186,12 +192,6 @@ fn make_opts() -> Options {
186192
"skip-children",
187193
"Don't reformat child modules (unstable).",
188194
);
189-
opts.optopt(
190-
"",
191-
"style-edition",
192-
"The edition of the Style Guide (unstable).",
193-
"[2015|2018|2021|2024]",
194-
);
195195
}
196196

197197
opts.optflag("v", "verbose", "Print verbose output");
@@ -628,6 +628,10 @@ impl GetOptsOptions {
628628
options.edition = Some(edition_from_edition_str(edition_str)?);
629629
}
630630

631+
if let Some(ref edition_str) = matches.opt_str("style-edition") {
632+
options.style_edition = Some(style_edition_from_style_edition_str(edition_str)?);
633+
}
634+
631635
if matches.opt_present("backup") {
632636
options.backup = true;
633637
}
@@ -654,10 +658,6 @@ impl GetOptsOptions {
654658
}
655659
}
656660

657-
if let Some(ref edition_str) = matches.opt_str("style-edition") {
658-
options.style_edition = Some(style_edition_from_style_edition_str(edition_str)?);
659-
}
660-
661661
Ok(options)
662662
}
663663

0 commit comments

Comments
 (0)