diff --git a/Configurations.md b/Configurations.md index 1811c3aa5c6..1d8774b6c55 100644 --- a/Configurations.md +++ b/Configurations.md @@ -166,7 +166,7 @@ Maximum length of comments. No effect unless`wrap_comments = true`. See also [`wrap_comments`](#wrap_comments). -## `condense_wildcard_suffices` +## `condense_wildcard_suffixes` Replace strings of _ wildcards by a single .. in tuple patterns diff --git a/src/config.rs b/src/config.rs index e8ecfa0f8e5..fa12f16a3dd 100644 --- a/src/config.rs +++ b/src/config.rs @@ -421,6 +421,6 @@ create_config! { use_try_shorthand: bool, false, "Replace uses of the try! macro by the ? shorthand"; write_mode: WriteMode, WriteMode::Replace, "What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage"; - condense_wildcard_suffices: bool, false, "Replace strings of _ wildcards by a single .. in \ + condense_wildcard_suffixes: bool, false, "Replace strings of _ wildcards by a single .. in \ tuple patterns" } diff --git a/src/patterns.rs b/src/patterns.rs index a1628888622..2b65604e6a8 100644 --- a/src/patterns.rs +++ b/src/patterns.rs @@ -295,7 +295,7 @@ fn rewrite_tuple_pat(pats: &[ptr::P], // Condense wildcard string suffix into a single .. let wildcard_suffix_len = count_wildcard_suffix_len(&items); - let list = if context.config.condense_wildcard_suffices && wildcard_suffix_len >= 2 { + let list = if context.config.condense_wildcard_suffixes && wildcard_suffix_len >= 2 { let new_item_count = 1 + pats.len() - wildcard_suffix_len; items[new_item_count - 1].item = Some("..".to_owned()); diff --git a/tests/source/configs-condense_wildcard_suffices-false.rs b/tests/source/configs-condense_wildcard_suffices-false.rs index e4ad1f2f3cc..3b967f35a8e 100644 --- a/tests/source/configs-condense_wildcard_suffices-false.rs +++ b/tests/source/configs-condense_wildcard_suffices-false.rs @@ -1,5 +1,5 @@ -// rustfmt-condense_wildcard_suffices: false -// Condense wildcard suffices +// rustfmt-condense_wildcard_suffixes: false +// Condense wildcard suffixes fn main() { let (lorem, ipsum, _, _) = (1, 2, 3, 4); diff --git a/tests/source/configs-condense_wildcard_suffices-true.rs b/tests/source/configs-condense_wildcard_suffices-true.rs index 2c8457a88d3..3798a6b9902 100644 --- a/tests/source/configs-condense_wildcard_suffices-true.rs +++ b/tests/source/configs-condense_wildcard_suffices-true.rs @@ -1,5 +1,5 @@ -// rustfmt-condense_wildcard_suffices: true -// Condense wildcard suffices +// rustfmt-condense_wildcard_suffixes: true +// Condense wildcard suffixes fn main() { let (lorem, ipsum, _, _) = (1, 2, 3, 4); diff --git a/tests/source/pattern-condense-wildcards.rs b/tests/source/pattern-condense-wildcards.rs index 5f84aea0a6b..244e935639a 100644 --- a/tests/source/pattern-condense-wildcards.rs +++ b/tests/source/pattern-condense-wildcards.rs @@ -1,5 +1,5 @@ // rustfmt-normalize_comments: true -// rustfmt-condense_wildcard_suffices: true +// rustfmt-condense_wildcard_suffixes: true fn main() { match x { diff --git a/tests/target/configs-condense_wildcard_suffices-false.rs b/tests/target/configs-condense_wildcard_suffices-false.rs index e4ad1f2f3cc..3b967f35a8e 100644 --- a/tests/target/configs-condense_wildcard_suffices-false.rs +++ b/tests/target/configs-condense_wildcard_suffices-false.rs @@ -1,5 +1,5 @@ -// rustfmt-condense_wildcard_suffices: false -// Condense wildcard suffices +// rustfmt-condense_wildcard_suffixes: false +// Condense wildcard suffixes fn main() { let (lorem, ipsum, _, _) = (1, 2, 3, 4); diff --git a/tests/target/configs-condense_wildcard_suffices-true.rs b/tests/target/configs-condense_wildcard_suffices-true.rs index 03bd0c4c6c8..4f880abe80e 100644 --- a/tests/target/configs-condense_wildcard_suffices-true.rs +++ b/tests/target/configs-condense_wildcard_suffices-true.rs @@ -1,5 +1,5 @@ -// rustfmt-condense_wildcard_suffices: true -// Condense wildcard suffices +// rustfmt-condense_wildcard_suffixes: true +// Condense wildcard suffixes fn main() { let (lorem, ipsum, ..) = (1, 2, 3, 4); diff --git a/tests/target/pattern-condense-wildcards.rs b/tests/target/pattern-condense-wildcards.rs index ebf89c582ff..acc41b73e18 100644 --- a/tests/target/pattern-condense-wildcards.rs +++ b/tests/target/pattern-condense-wildcards.rs @@ -1,5 +1,5 @@ // rustfmt-normalize_comments: true -// rustfmt-condense_wildcard_suffices: true +// rustfmt-condense_wildcard_suffixes: true fn main() { match x {