Skip to content

Commit

Permalink
make style-edition a stable option on the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
ytmimi committed Jan 2, 2025
1 parent ab98945 commit f649c4c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ fn make_opts() -> Options {
"Rust edition to use",
"[2015|2018|2021|2024]",
);
opts.optopt(
"",
"style-edition",
"The edition of the Style Guide (unstable).",
"[2015|2018|2021|2024]",
);
opts.optopt(
"",
"color",
Expand Down Expand Up @@ -186,12 +192,6 @@ fn make_opts() -> Options {
"skip-children",
"Don't reformat child modules (unstable).",
);
opts.optopt(
"",
"style-edition",
"The edition of the Style Guide (unstable).",
"[2015|2018|2021|2024]",
);
}

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

if let Some(ref edition_str) = matches.opt_str("style-edition") {
options.style_edition = Some(style_edition_from_style_edition_str(edition_str)?);
}

if matches.opt_present("backup") {
options.backup = true;
}
Expand All @@ -654,10 +658,6 @@ impl GetOptsOptions {
}
}

if let Some(ref edition_str) = matches.opt_str("style-edition") {
options.style_edition = Some(style_edition_from_style_edition_str(edition_str)?);
}

Ok(options)
}

Expand Down

0 comments on commit f649c4c

Please sign in to comment.