chore: apply review suggestions

This commit is contained in:
Caleb Cartwright 2024-07-28 18:58:38 -05:00 committed by Caleb Cartwright
parent d66ab31b53
commit cf352a766f
3 changed files with 9 additions and 5 deletions

View File

@ -2698,7 +2698,7 @@ Controls the edition of the [Rust Style Guide] to use for formatting ([RFC 3338]
- **Default value**: `"2015"`
- **Possible values**: `"2015"`, `"2018"`, `"2021"`, `"2024"` (unstable variant)
- **Stable**: Yes
- **Stable**: No
[Rust Style Guide]: https://doc.rust-lang.org/nightly/style-guide/
[RFC 3338]: https://rust-lang.github.io/rfcs/3338-style-evolution.html

View File

@ -581,8 +581,8 @@ fn set_version(&mut self) {
if self.was_set().style_edition() || self.was_set_cli().style_edition() {
eprintln!(
"Warning: the deprecated `version` option was \
used in conjunction with the `edition` or \
`style_edition` options which take precedence. \
used in conjunction with the `style_edition` \
option which takes precedence. \
The value of the `version` option will be ignored."
);
} else if matches!(self.version(), Version::Two) {

View File

@ -200,8 +200,12 @@ fn special_cases(&self, config: &Config) -> impl Iterator<Item = &(&'static str,
OverflowableItem::NestedMetaItem(..) => SPECIAL_CASE_ATTR,
_ => &[],
};
let additional_cases = match (self, config.style_edition()) {
(OverflowableItem::MacroArg(..), StyleEdition::Edition2024) => SPECIAL_CASE_MACROS_V2,
let additional_cases = match self {
OverflowableItem::MacroArg(..)
if config.style_edition() >= StyleEdition::Edition2024 =>
{
SPECIAL_CASE_MACROS_V2
}
_ => &[],
};
base_cases.iter().chain(additional_cases)