From 4926b7e94efc870c099128cd9b0e08b8d3fd99d0 Mon Sep 17 00:00:00 2001 From: Sjael Date: Sat, 27 Jan 2024 20:37:46 -0800 Subject: [PATCH 1/7] first draft, tests OK --- Configurations.md | 14 ++++++++++++++ src/config/config_type.rs | 10 ++++++++++ src/config/mod.rs | 3 +++ src/config/options.rs | 5 +++++ src/items.rs | 13 +++++++++++-- tests/source/fn_width/100.rs | 18 ++++++++++++++++++ tests/source/fn_width/150.rs | 18 ++++++++++++++++++ tests/source/fn_width/50.rs | 18 ++++++++++++++++++ tests/target/fn_width/100.rs | 28 ++++++++++++++++++++++++++++ tests/target/fn_width/150.rs | 18 ++++++++++++++++++ tests/target/fn_width/50.rs | 36 ++++++++++++++++++++++++++++++++++++ 11 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 tests/source/fn_width/100.rs create mode 100644 tests/source/fn_width/150.rs create mode 100644 tests/source/fn_width/50.rs create mode 100644 tests/target/fn_width/100.rs create mode 100644 tests/target/fn_width/150.rs create mode 100644 tests/target/fn_width/50.rs diff --git a/Configurations.md b/Configurations.md index 78545c6187a..dd49b50e835 100644 --- a/Configurations.md +++ b/Configurations.md @@ -768,6 +768,20 @@ By default this option is set as a percentage of [`max_width`](#max_width) provi See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics) + +## `fn_width` + +Maximum width of the declaration of a function signature before falling back to formatting chosen with `fn_param_layout`. + +- **Default value**: `100` +- **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width) +- **Stable**: Yes + +By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_width` will take precedence. + +See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics) + + ## `fn_params_layout` Control the layout of parameters in function signatures. diff --git a/src/config/config_type.rs b/src/config/config_type.rs index f7cff1a1729..f2e81008f28 100644 --- a/src/config/config_type.rs +++ b/src/config/config_type.rs @@ -122,6 +122,7 @@ macro_rules! create_config { | "fn_call_width" | "single_line_if_else_max_width" | "single_line_let_else_max_width" + | "fn_width" | "attr_fn_like_width" | "struct_lit_width" | "struct_variant_width" @@ -273,6 +274,7 @@ macro_rules! create_config { | "fn_call_width" | "single_line_if_else_max_width" | "single_line_let_else_max_width" + | "fn_width" | "attr_fn_like_width" | "struct_lit_width" | "struct_variant_width" @@ -421,6 +423,14 @@ macro_rules! create_config { "single_line_let_else_max_width", ); self.single_line_let_else_max_width.2 = single_line_let_else_max_width; + + let fn_width = get_width_value( + self.was_set().fn_width(), + self.fn_width.2, + heuristics.fn_width, + "fn_width", + ); + self.fn_width.2 = fn_width; } fn set_heuristics(&mut self) { diff --git a/src/config/mod.rs b/src/config/mod.rs index 9484b2e5829..8cc84ef82be 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -61,6 +61,7 @@ create_config! { single_line_let_else_max_width: usize, 50, true, "Maximum line length for single line \ let-else statements. A value of zero means always format the divergent `else` block \ over multiple lines."; + fn_width: usize, 100, true, "Maximum line length for function declarations."; // Comments. macros, and strings wrap_comments: bool, false, false, "Break comments to fit on the line"; @@ -490,6 +491,7 @@ mod test { single_line_let_else_max_width: usize, 50, false, "Maximum line length for single \ line let-else statements. A value of zero means always format the divergent \ `else` block over multiple lines."; + fn_width: usize, 100, true, "Maximum line length for function declarations."; // Options that are used by the tests stable_option: bool, false, true, "A stable option"; @@ -634,6 +636,7 @@ array_width = 60 chain_width = 60 single_line_if_else_max_width = 50 single_line_let_else_max_width = 50 +fn_width = 100 wrap_comments = false format_code_in_doc_comments = false doc_comment_code_block_width = 100 diff --git a/src/config/options.rs b/src/config/options.rs index 3c5c713a33a..95e137e58c7 100644 --- a/src/config/options.rs +++ b/src/config/options.rs @@ -241,6 +241,8 @@ pub struct WidthHeuristics { // Maximum line length for single line let-else statements. A value of zero means // always format the divergent `else` block over multiple lines. pub(crate) single_line_let_else_max_width: usize, + // Maximum line length for function declarations. + pub(crate) fn_width: usize, } impl fmt::Display for WidthHeuristics { @@ -261,6 +263,7 @@ impl WidthHeuristics { chain_width: usize::max_value(), single_line_if_else_max_width: 0, single_line_let_else_max_width: 0, + fn_width: usize::max_value(), } } @@ -274,6 +277,7 @@ impl WidthHeuristics { chain_width: max_width, single_line_if_else_max_width: max_width, single_line_let_else_max_width: max_width, + fn_width: max_width, } } @@ -296,6 +300,7 @@ impl WidthHeuristics { chain_width: (60.0 * max_width_ratio).round() as usize, single_line_if_else_max_width: (50.0 * max_width_ratio).round() as usize, single_line_let_else_max_width: (50.0 * max_width_ratio).round() as usize, + fn_width: (100.0 * max_width_ratio).round() as usize, } } } diff --git a/src/items.rs b/src/items.rs index 8669bdda32b..cba9c93cb3e 100644 --- a/src/items.rs +++ b/src/items.rs @@ -2353,7 +2353,13 @@ fn rewrite_fn_base( 2 }; let used_width = last_line_used_width(&result, indent.width()); - let one_line_budget = context.budget(used_width + overhead); + let one_line_budget = std::cmp::min( + context.budget(used_width + overhead), + context + .config + .fn_width() + .saturating_sub(used_width + overhead), + ); let shape = Shape { width: one_line_budget, indent, @@ -2797,7 +2803,10 @@ fn compute_budgets_for_params( FnBraceStyle::SameLine => used_space += 2, // 2 = `{}` FnBraceStyle::NextLine => (), } - let one_line_budget = context.budget(used_space); + let one_line_budget = std::cmp::min( + context.budget(used_space), + context.config.fn_width().saturating_sub(used_space), + ); if one_line_budget > 0 { // 4 = "() {".len() diff --git a/tests/source/fn_width/100.rs b/tests/source/fn_width/100.rs new file mode 100644 index 00000000000..bc92207fdb6 --- /dev/null +++ b/tests/source/fn_width/100.rs @@ -0,0 +1,18 @@ +// rustfmt-max_width: 100 +// rustfmt-fn_width: 100 + +impl Trait { + fn lorem(first: First, second: Second); + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter); + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter); + + fn lorem(first: First, second: Second) { + // block + } + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter) { + // block + } + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter) { + // block + } +} \ No newline at end of file diff --git a/tests/source/fn_width/150.rs b/tests/source/fn_width/150.rs new file mode 100644 index 00000000000..5f8e8b20f77 --- /dev/null +++ b/tests/source/fn_width/150.rs @@ -0,0 +1,18 @@ +// rustfmt-max_width: 150 +// rustfmt-fn_width: 150 + +impl Trait { + fn lorem(first: First, second: Second); + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter); + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter); + + fn lorem(first: First, second: Second) { + // block + } + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter) { + // block + } + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter) { + // block + } +} \ No newline at end of file diff --git a/tests/source/fn_width/50.rs b/tests/source/fn_width/50.rs new file mode 100644 index 00000000000..4a15f01a9d3 --- /dev/null +++ b/tests/source/fn_width/50.rs @@ -0,0 +1,18 @@ +// rustfmt-max_width: 100 +// rustfmt-fn_width: 50 + +impl Trait { + fn lorem(first: First, second: Second); + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter); + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter); + + fn lorem(first: First, second: Second) { + // block + } + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter) { + // block + } + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter) { + // block + } +} \ No newline at end of file diff --git a/tests/target/fn_width/100.rs b/tests/target/fn_width/100.rs new file mode 100644 index 00000000000..a8a2067df70 --- /dev/null +++ b/tests/target/fn_width/100.rs @@ -0,0 +1,28 @@ +// rustfmt-max_width: 100 +// rustfmt-fn_width: 100 + +impl Trait { + fn lorem(first: First, second: Second); + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter); + fn lorem( + first: FirstParameter, + second: SecondParameter, + third: ThirdParameter, + fourth: FourthParameter, + ); + + fn lorem(first: First, second: Second) { + // block + } + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter) { + // block + } + fn lorem( + first: FirstParameter, + second: SecondParameter, + third: ThirdParameter, + fourth: FourthParameter, + ) { + // block + } +} diff --git a/tests/target/fn_width/150.rs b/tests/target/fn_width/150.rs new file mode 100644 index 00000000000..1b7faf05e6b --- /dev/null +++ b/tests/target/fn_width/150.rs @@ -0,0 +1,18 @@ +// rustfmt-max_width: 150 +// rustfmt-fn_width: 150 + +impl Trait { + fn lorem(first: First, second: Second); + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter); + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter); + + fn lorem(first: First, second: Second) { + // block + } + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter) { + // block + } + fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter) { + // block + } +} diff --git a/tests/target/fn_width/50.rs b/tests/target/fn_width/50.rs new file mode 100644 index 00000000000..9d7e4074eec --- /dev/null +++ b/tests/target/fn_width/50.rs @@ -0,0 +1,36 @@ +// rustfmt-max_width: 100 +// rustfmt-fn_width: 50 + +impl Trait { + fn lorem(first: First, second: Second); + fn lorem( + first: FirstParameter, + second: SecondParameter, + third: ThirdParameter, + ); + fn lorem( + first: FirstParameter, + second: SecondParameter, + third: ThirdParameter, + fourth: FourthParameter, + ); + + fn lorem(first: First, second: Second) { + // block + } + fn lorem( + first: FirstParameter, + second: SecondParameter, + third: ThirdParameter, + ) { + // block + } + fn lorem( + first: FirstParameter, + second: SecondParameter, + third: ThirdParameter, + fourth: FourthParameter, + ) { + // block + } +} From 86f6073880e0b3a504948b3089a4bc78d27db30f Mon Sep 17 00:00:00 2001 From: Sjael Date: Sat, 27 Jan 2024 21:07:29 -0800 Subject: [PATCH 2/7] linux/mac test retry --- tests/config/fn_width_100.toml | 2 ++ tests/config/fn_width_150.toml | 2 ++ tests/config/fn_width_50.toml | 2 ++ tests/source/fn_width/100.rs | 3 +-- tests/source/fn_width/150.rs | 3 +-- tests/source/fn_width/50.rs | 3 +-- tests/target/fn_width/100.rs | 3 +-- tests/target/fn_width/150.rs | 3 +-- tests/target/fn_width/50.rs | 3 +-- 9 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 tests/config/fn_width_100.toml create mode 100644 tests/config/fn_width_150.toml create mode 100644 tests/config/fn_width_50.toml diff --git a/tests/config/fn_width_100.toml b/tests/config/fn_width_100.toml new file mode 100644 index 00000000000..0543d5a079c --- /dev/null +++ b/tests/config/fn_width_100.toml @@ -0,0 +1,2 @@ +max_width = 100 +fn_width = 100 \ No newline at end of file diff --git a/tests/config/fn_width_150.toml b/tests/config/fn_width_150.toml new file mode 100644 index 00000000000..070c70390bb --- /dev/null +++ b/tests/config/fn_width_150.toml @@ -0,0 +1,2 @@ +max_width = 150 +fn_width = 150 \ No newline at end of file diff --git a/tests/config/fn_width_50.toml b/tests/config/fn_width_50.toml new file mode 100644 index 00000000000..b36466a4da3 --- /dev/null +++ b/tests/config/fn_width_50.toml @@ -0,0 +1,2 @@ +max_width = 50 +fn_width = 50 \ No newline at end of file diff --git a/tests/source/fn_width/100.rs b/tests/source/fn_width/100.rs index bc92207fdb6..f9c31623982 100644 --- a/tests/source/fn_width/100.rs +++ b/tests/source/fn_width/100.rs @@ -1,5 +1,4 @@ -// rustfmt-max_width: 100 -// rustfmt-fn_width: 100 +// rustfmt-config: fn_width_100.toml impl Trait { fn lorem(first: First, second: Second); diff --git a/tests/source/fn_width/150.rs b/tests/source/fn_width/150.rs index 5f8e8b20f77..459de780d1a 100644 --- a/tests/source/fn_width/150.rs +++ b/tests/source/fn_width/150.rs @@ -1,5 +1,4 @@ -// rustfmt-max_width: 150 -// rustfmt-fn_width: 150 +// rustfmt-config: fn_width_150.toml impl Trait { fn lorem(first: First, second: Second); diff --git a/tests/source/fn_width/50.rs b/tests/source/fn_width/50.rs index 4a15f01a9d3..00c00173268 100644 --- a/tests/source/fn_width/50.rs +++ b/tests/source/fn_width/50.rs @@ -1,5 +1,4 @@ -// rustfmt-max_width: 100 -// rustfmt-fn_width: 50 +// rustfmt-config: fn_width_50.toml impl Trait { fn lorem(first: First, second: Second); diff --git a/tests/target/fn_width/100.rs b/tests/target/fn_width/100.rs index a8a2067df70..d1fb1c064d5 100644 --- a/tests/target/fn_width/100.rs +++ b/tests/target/fn_width/100.rs @@ -1,5 +1,4 @@ -// rustfmt-max_width: 100 -// rustfmt-fn_width: 100 +// rustfmt-config: fn_width_100.toml impl Trait { fn lorem(first: First, second: Second); diff --git a/tests/target/fn_width/150.rs b/tests/target/fn_width/150.rs index 1b7faf05e6b..60c3fc50250 100644 --- a/tests/target/fn_width/150.rs +++ b/tests/target/fn_width/150.rs @@ -1,5 +1,4 @@ -// rustfmt-max_width: 150 -// rustfmt-fn_width: 150 +// rustfmt-config: fn_width_150.toml impl Trait { fn lorem(first: First, second: Second); diff --git a/tests/target/fn_width/50.rs b/tests/target/fn_width/50.rs index 9d7e4074eec..2e45fa00963 100644 --- a/tests/target/fn_width/50.rs +++ b/tests/target/fn_width/50.rs @@ -1,5 +1,4 @@ -// rustfmt-max_width: 100 -// rustfmt-fn_width: 50 +// rustfmt-config: fn_width_50.toml impl Trait { fn lorem(first: First, second: Second); From 1bcd1e391358bb43643604cd2b7c64c9e9093dd9 Mon Sep 17 00:00:00 2001 From: Sjael Date: Fri, 23 Feb 2024 13:02:46 -0800 Subject: [PATCH 3/7] test 1 --- Cargo.lock | 395 ++++++++++-------- Configurations.md | 8 +- src/config/config_type.rs | 16 +- src/config/mod.rs | 6 +- src/config/options.rs | 8 +- src/items.rs | 4 +- tests/config/fn_param_width/0.toml | 2 + tests/config/fn_param_width/100.toml | 2 + tests/config/fn_param_width/150.toml | 2 + tests/config/fn_param_width/50.toml | 2 + tests/config/fn_width_100.toml | 2 - tests/config/fn_width_150.toml | 2 - tests/config/fn_width_50.toml | 2 - tests/source/config/fn_param_width/0.rs | 103 +++++ .../fn_param_width}/100.rs | 2 +- .../fn_param_width}/150.rs | 2 +- .../{fn_width => config/fn_param_width}/50.rs | 2 +- tests/target/config/fn_param_width/0.rs | 176 ++++++++ .../fn_param_width}/100.rs | 2 +- .../fn_param_width}/150.rs | 2 +- .../{fn_width => config/fn_param_width}/50.rs | 2 +- 21 files changed, 534 insertions(+), 208 deletions(-) create mode 100644 tests/config/fn_param_width/0.toml create mode 100644 tests/config/fn_param_width/100.toml create mode 100644 tests/config/fn_param_width/150.toml create mode 100644 tests/config/fn_param_width/50.toml delete mode 100644 tests/config/fn_width_100.toml delete mode 100644 tests/config/fn_width_150.toml delete mode 100644 tests/config/fn_width_50.toml create mode 100644 tests/source/config/fn_param_width/0.rs rename tests/source/{fn_width => config/fn_param_width}/100.rs (92%) rename tests/source/{fn_width => config/fn_param_width}/150.rs (92%) rename tests/source/{fn_width => config/fn_param_width}/50.rs (93%) create mode 100644 tests/target/config/fn_param_width/0.rs rename tests/target/{fn_width => config/fn_param_width}/100.rs (93%) rename tests/target/{fn_width => config/fn_param_width}/150.rs (92%) rename tests/target/{fn_width => config/fn_param_width}/50.rs (94%) diff --git a/Cargo.lock b/Cargo.lock index ee396cce26a..b1eb55ff101 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "aho-corasick" -version = "0.7.18" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "annotate-snippets" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b9d411ecbaf79885c6df4d75fff75858d5995ff25385657a28af47e82f9c36" +checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e" dependencies = [ "unicode-width", "yansi-term", @@ -23,9 +23,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" dependencies = [ "anstyle", "anstyle-parse", @@ -37,33 +37,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.3" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", "windows-sys", @@ -71,9 +71,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.56" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "autocfg" @@ -87,38 +87,45 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + [[package]] name = "bstr" -version = "0.2.17" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", + "serde", ] [[package]] name = "bytecount" -version = "0.6.4" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad152d03a2c813c80bb94fedbf3a3f02b28f793e39e7c214c8a0bcc196343de7" +checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" dependencies = [ "packed_simd", ] [[package]] name = "camino" -version = "1.0.7" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3132262930b0522068049f5870a856ab8affc80c70d08b6ecb785771a6fc23" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -145,9 +152,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.2" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", "clap_derive", @@ -165,9 +172,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", @@ -177,9 +184,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", @@ -189,9 +196,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -200,20 +207,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-deque" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + [[package]] name = "diff" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] name = "dirs" @@ -258,15 +280,15 @@ dependencies = [ [[package]] name = "either" -version = "1.6.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] -name = "fnv" -version = "1.0.7" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "getopts" @@ -279,9 +301,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -290,54 +312,52 @@ dependencies = [ [[package]] name = "globset" -version = "0.4.8" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.5", + "regex-syntax 0.8.2", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "ignore" -version = "0.4.18" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" dependencies = [ - "crossbeam-utils", + "crossbeam-deque", "globset", - "lazy_static", "log", "memchr", - "regex", + "regex-automata 0.4.5", "same-file", - "thread_local", "walkdir", "winapi-util", ] [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] @@ -352,9 +372,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "lazy_static" @@ -364,9 +384,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.141" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libm" @@ -375,28 +395,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "log" -version = "0.4.16" +name = "libredox" +version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "cfg-if", + "bitflags 2.4.2", + "libc", + "redox_syscall", ] +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + [[package]] name = "matchers" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] name = "memchr" -version = "2.4.1" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "nu-ansi-term" @@ -410,9 +438,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -420,9 +448,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "overload" @@ -442,57 +470,58 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom", - "redox_syscall", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.7.3" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.4.5", + "regex-syntax 0.8.2", ] [[package]] @@ -501,7 +530,18 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", ] [[package]] @@ -510,6 +550,12 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + [[package]] name = "rustfmt-config_proc_macro" version = "0.3.0" @@ -551,15 +597,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.6" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -572,27 +618,27 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.7" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.160" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.160" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", @@ -601,9 +647,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.79" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -612,39 +658,39 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "syn" -version = "2.0.14" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf316d5356ed6847742d036f8a39c3b8435cac10bd528a4bd461928a6ab34d5" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -664,18 +710,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", @@ -684,18 +730,19 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ + "cfg-if", "once_cell", ] [[package]] name = "toml" -version = "0.7.4" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", @@ -705,18 +752,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap", "serde", @@ -727,11 +774,10 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -739,9 +785,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -750,9 +796,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -760,20 +806,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -789,27 +835,27 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-properties" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f91c8b21fbbaa18853c3d0801c78f4fc94cdb976699bb03e832e75f7fd22f0" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "utf8parse" @@ -825,20 +871,19 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", - "winapi", "winapi-util", ] [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "winapi" @@ -858,9 +903,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -873,18 +918,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -897,51 +942,51 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.4.7" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] diff --git a/Configurations.md b/Configurations.md index dd49b50e835..8043aff7d05 100644 --- a/Configurations.md +++ b/Configurations.md @@ -766,18 +766,18 @@ Maximum width of the args of a function call before falling back to vertical for By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_call_width` will take precedence. -See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics) +See also [`fn_param_width`](#fn_param_width), [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics) -## `fn_width` +## `fn_param_width` Maximum width of the declaration of a function signature before falling back to formatting chosen with `fn_param_layout`. - **Default value**: `100` - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width) -- **Stable**: Yes +- **Stable**: No -By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_width` will take precedence. +By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_param_width` will take precedence. See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics) diff --git a/src/config/config_type.rs b/src/config/config_type.rs index f2e81008f28..deabea01d2e 100644 --- a/src/config/config_type.rs +++ b/src/config/config_type.rs @@ -122,7 +122,7 @@ macro_rules! create_config { | "fn_call_width" | "single_line_if_else_max_width" | "single_line_let_else_max_width" - | "fn_width" + | "fn_param_width" | "attr_fn_like_width" | "struct_lit_width" | "struct_variant_width" @@ -274,7 +274,7 @@ macro_rules! create_config { | "fn_call_width" | "single_line_if_else_max_width" | "single_line_let_else_max_width" - | "fn_width" + | "fn_param_width" | "attr_fn_like_width" | "struct_lit_width" | "struct_variant_width" @@ -424,13 +424,13 @@ macro_rules! create_config { ); self.single_line_let_else_max_width.2 = single_line_let_else_max_width; - let fn_width = get_width_value( - self.was_set().fn_width(), - self.fn_width.2, - heuristics.fn_width, - "fn_width", + let fn_param_width = get_width_value( + self.was_set().fn_param_width(), + self.fn_param_width.2, + heuristics.fn_param_width, + "fn_param_width", ); - self.fn_width.2 = fn_width; + self.fn_param_width.2 = fn_param_width; } fn set_heuristics(&mut self) { diff --git a/src/config/mod.rs b/src/config/mod.rs index 8cc84ef82be..04aeb55452a 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -61,7 +61,7 @@ create_config! { single_line_let_else_max_width: usize, 50, true, "Maximum line length for single line \ let-else statements. A value of zero means always format the divergent `else` block \ over multiple lines."; - fn_width: usize, 100, true, "Maximum line length for function declarations."; + fn_param_width: usize, 100, false, "Maximum line length for function declarations."; // Comments. macros, and strings wrap_comments: bool, false, false, "Break comments to fit on the line"; @@ -491,7 +491,7 @@ mod test { single_line_let_else_max_width: usize, 50, false, "Maximum line length for single \ line let-else statements. A value of zero means always format the divergent \ `else` block over multiple lines."; - fn_width: usize, 100, true, "Maximum line length for function declarations."; + fn_param_width: usize, 100, true, "Maximum line length for function declarations."; // Options that are used by the tests stable_option: bool, false, true, "A stable option"; @@ -636,7 +636,7 @@ array_width = 60 chain_width = 60 single_line_if_else_max_width = 50 single_line_let_else_max_width = 50 -fn_width = 100 +fn_param_width = 100 wrap_comments = false format_code_in_doc_comments = false doc_comment_code_block_width = 100 diff --git a/src/config/options.rs b/src/config/options.rs index 95e137e58c7..50f903ca71b 100644 --- a/src/config/options.rs +++ b/src/config/options.rs @@ -242,7 +242,7 @@ pub struct WidthHeuristics { // always format the divergent `else` block over multiple lines. pub(crate) single_line_let_else_max_width: usize, // Maximum line length for function declarations. - pub(crate) fn_width: usize, + pub(crate) fn_param_width: usize, } impl fmt::Display for WidthHeuristics { @@ -263,7 +263,7 @@ impl WidthHeuristics { chain_width: usize::max_value(), single_line_if_else_max_width: 0, single_line_let_else_max_width: 0, - fn_width: usize::max_value(), + fn_param_width: usize::max_value(), } } @@ -277,7 +277,7 @@ impl WidthHeuristics { chain_width: max_width, single_line_if_else_max_width: max_width, single_line_let_else_max_width: max_width, - fn_width: max_width, + fn_param_width: max_width, } } @@ -300,7 +300,7 @@ impl WidthHeuristics { chain_width: (60.0 * max_width_ratio).round() as usize, single_line_if_else_max_width: (50.0 * max_width_ratio).round() as usize, single_line_let_else_max_width: (50.0 * max_width_ratio).round() as usize, - fn_width: (100.0 * max_width_ratio).round() as usize, + fn_param_width: (100.0 * max_width_ratio).round() as usize, } } } diff --git a/src/items.rs b/src/items.rs index cba9c93cb3e..845de0209ce 100644 --- a/src/items.rs +++ b/src/items.rs @@ -2357,7 +2357,7 @@ fn rewrite_fn_base( context.budget(used_width + overhead), context .config - .fn_width() + .fn_param_width() .saturating_sub(used_width + overhead), ); let shape = Shape { @@ -2805,7 +2805,7 @@ fn compute_budgets_for_params( } let one_line_budget = std::cmp::min( context.budget(used_space), - context.config.fn_width().saturating_sub(used_space), + context.config.fn_param_width().saturating_sub(used_space), ); if one_line_budget > 0 { diff --git a/tests/config/fn_param_width/0.toml b/tests/config/fn_param_width/0.toml new file mode 100644 index 00000000000..976448c21ea --- /dev/null +++ b/tests/config/fn_param_width/0.toml @@ -0,0 +1,2 @@ +max_width = 100 +fn_param_width = 0 \ No newline at end of file diff --git a/tests/config/fn_param_width/100.toml b/tests/config/fn_param_width/100.toml new file mode 100644 index 00000000000..3ae9cc80aa3 --- /dev/null +++ b/tests/config/fn_param_width/100.toml @@ -0,0 +1,2 @@ +max_width = 100 +fn_param_width = 100 \ No newline at end of file diff --git a/tests/config/fn_param_width/150.toml b/tests/config/fn_param_width/150.toml new file mode 100644 index 00000000000..46a847f5ce3 --- /dev/null +++ b/tests/config/fn_param_width/150.toml @@ -0,0 +1,2 @@ +max_width = 150 +fn_param_width = 150 \ No newline at end of file diff --git a/tests/config/fn_param_width/50.toml b/tests/config/fn_param_width/50.toml new file mode 100644 index 00000000000..80e4fa3cd62 --- /dev/null +++ b/tests/config/fn_param_width/50.toml @@ -0,0 +1,2 @@ +max_width = 50 +fn_param_width = 50 \ No newline at end of file diff --git a/tests/config/fn_width_100.toml b/tests/config/fn_width_100.toml deleted file mode 100644 index 0543d5a079c..00000000000 --- a/tests/config/fn_width_100.toml +++ /dev/null @@ -1,2 +0,0 @@ -max_width = 100 -fn_width = 100 \ No newline at end of file diff --git a/tests/config/fn_width_150.toml b/tests/config/fn_width_150.toml deleted file mode 100644 index 070c70390bb..00000000000 --- a/tests/config/fn_width_150.toml +++ /dev/null @@ -1,2 +0,0 @@ -max_width = 150 -fn_width = 150 \ No newline at end of file diff --git a/tests/config/fn_width_50.toml b/tests/config/fn_width_50.toml deleted file mode 100644 index b36466a4da3..00000000000 --- a/tests/config/fn_width_50.toml +++ /dev/null @@ -1,2 +0,0 @@ -max_width = 50 -fn_width = 50 \ No newline at end of file diff --git a/tests/source/config/fn_param_width/0.rs b/tests/source/config/fn_param_width/0.rs new file mode 100644 index 00000000000..3e0456d80f1 --- /dev/null +++ b/tests/source/config/fn_param_width/0.rs @@ -0,0 +1,103 @@ +// rustfmt-config: fn_param_width/0.toml + + + +fn lorem(mut commands: Commands, icons: Res) { + // block +} + +fn ret(mut commands: Commands, icons: Res) -> bool { + // block +} + +unsafe fn lorem(mut commands: Commands, icons: Res) { + // block +} + +fn lagging(mut commands: Commands, icons: Res) { + // block +} + +pub fn public(mut commands: Commands, icons: Res) { + // block +} + +pub(super) fn up(mut commands: Commands, icons: Res) { + // block +} + +pub(crate) fn all(mut commands: Commands, icons: Res) { + // block +} + +pub unsafe fn complicated(mut commands: Commands, icons: Res) { + // block +} + +extern "C" { + fn foreign(mut commands: Commands, icons: Res) { + // block + } +} + +fn homura>(_: T) {} + +fn generic(query: Query) { + // block +} + +pub fn setup_arena( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, + //models: Res, +) { + // block +} + +fn comments(mut commands: Commands, /* intermission */ icons: Res) { + // block +} + +fn spacing(mut commands: Commands, icons: Res) { + // block +} + +impl Trait { + fn lorem(mut commands: Commands, icons: Res); + fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>); + fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>); + + fn lorem(mut commands: Commands) { + // block + } + fn lorem(mut commands: Commands, icons: Res) { + // block + } + fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + } + fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>) { + // block + } +} + + + +fn outer(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + + fn inner(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + } +} + +mod example { + fn mod_func(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + fn nested(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + } + } +} \ No newline at end of file diff --git a/tests/source/fn_width/100.rs b/tests/source/config/fn_param_width/100.rs similarity index 92% rename from tests/source/fn_width/100.rs rename to tests/source/config/fn_param_width/100.rs index f9c31623982..5107ac49561 100644 --- a/tests/source/fn_width/100.rs +++ b/tests/source/config/fn_param_width/100.rs @@ -1,4 +1,4 @@ -// rustfmt-config: fn_width_100.toml +// rustfmt-config: fn_param_width/100.toml impl Trait { fn lorem(first: First, second: Second); diff --git a/tests/source/fn_width/150.rs b/tests/source/config/fn_param_width/150.rs similarity index 92% rename from tests/source/fn_width/150.rs rename to tests/source/config/fn_param_width/150.rs index 459de780d1a..1979a2ca9f2 100644 --- a/tests/source/fn_width/150.rs +++ b/tests/source/config/fn_param_width/150.rs @@ -1,4 +1,4 @@ -// rustfmt-config: fn_width_150.toml +// rustfmt-config: fn_param_width/150.toml impl Trait { fn lorem(first: First, second: Second); diff --git a/tests/source/fn_width/50.rs b/tests/source/config/fn_param_width/50.rs similarity index 93% rename from tests/source/fn_width/50.rs rename to tests/source/config/fn_param_width/50.rs index 00c00173268..c17c4014fb2 100644 --- a/tests/source/fn_width/50.rs +++ b/tests/source/config/fn_param_width/50.rs @@ -1,4 +1,4 @@ -// rustfmt-config: fn_width_50.toml +// rustfmt-config: fn_param_width/50.toml impl Trait { fn lorem(first: First, second: Second); diff --git a/tests/target/config/fn_param_width/0.rs b/tests/target/config/fn_param_width/0.rs new file mode 100644 index 00000000000..78c444e2351 --- /dev/null +++ b/tests/target/config/fn_param_width/0.rs @@ -0,0 +1,176 @@ +// rustfmt-config: fn_param_width/0.toml + +fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +fn ret( + mut commands: Commands, + icons: Res, +) -> bool { + // block +} + +unsafe fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +fn lagging( + mut commands: Commands, + icons: Res, +) { + // block +} + +pub fn public( + mut commands: Commands, + icons: Res, +) { + // block +} + +pub(super) fn up( + mut commands: Commands, + icons: Res, +) { + // block +} + +pub(crate) fn all( + mut commands: Commands, + icons: Res, +) { + // block +} + +pub unsafe fn complicated( + mut commands: Commands, + icons: Res, +) { + // block +} + +extern "C" { + fn foreign( + mut commands: Commands, + icons: Res, + ) { + // block + } +} + +fn homura>(_: T) {} + +fn generic( + query: Query, +) { + // block +} + +pub fn setup_arena( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, + //models: Res, +) { + // block +} + +fn comments( + mut commands: Commands, + /* intermission */ icons: Res, +) { + // block +} + +fn spacing( + mut commands: Commands, + icons: Res, +) { + // block +} + +impl Trait { + fn lorem( + mut commands: Commands, + icons: Res, + ); + fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + ); + fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, + ); + + fn lorem( + mut commands: Commands, + ) { + // block + } + fn lorem( + mut commands: Commands, + icons: Res, + ) { + // block + } + fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + ) { + // block + } + fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, + ) { + // block + } +} + +fn outer( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, +) { + // block + + fn inner( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + ) { + // block + } +} + +mod example { + fn mod_func( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + ) { + // block + fn nested( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + ) { + // block + } + } +} diff --git a/tests/target/fn_width/100.rs b/tests/target/config/fn_param_width/100.rs similarity index 93% rename from tests/target/fn_width/100.rs rename to tests/target/config/fn_param_width/100.rs index d1fb1c064d5..f16269cb197 100644 --- a/tests/target/fn_width/100.rs +++ b/tests/target/config/fn_param_width/100.rs @@ -1,4 +1,4 @@ -// rustfmt-config: fn_width_100.toml +// rustfmt-config: fn_param_width/100.toml impl Trait { fn lorem(first: First, second: Second); diff --git a/tests/target/fn_width/150.rs b/tests/target/config/fn_param_width/150.rs similarity index 92% rename from tests/target/fn_width/150.rs rename to tests/target/config/fn_param_width/150.rs index 60c3fc50250..a933acf0e3a 100644 --- a/tests/target/fn_width/150.rs +++ b/tests/target/config/fn_param_width/150.rs @@ -1,4 +1,4 @@ -// rustfmt-config: fn_width_150.toml +// rustfmt-config: fn_param_width/150.toml impl Trait { fn lorem(first: First, second: Second); diff --git a/tests/target/fn_width/50.rs b/tests/target/config/fn_param_width/50.rs similarity index 94% rename from tests/target/fn_width/50.rs rename to tests/target/config/fn_param_width/50.rs index 2e45fa00963..6d7b9ecc1eb 100644 --- a/tests/target/fn_width/50.rs +++ b/tests/target/config/fn_param_width/50.rs @@ -1,4 +1,4 @@ -// rustfmt-config: fn_width_50.toml +// rustfmt-config: fn_param_width/50.toml impl Trait { fn lorem(first: First, second: Second); From c48181ee5bf97187fa3917c28b21fa4a4ab8209e Mon Sep 17 00:00:00 2001 From: Sjael Date: Mon, 26 Feb 2024 14:25:03 -0800 Subject: [PATCH 4/7] refined tests --- Cargo.lock | 36 ++++----- src/items.rs | 8 +- tests/config/fn_param_width/0.toml | 1 - tests/config/fn_param_width/100.toml | 1 - tests/config/fn_param_width/50.toml | 1 - tests/source/config/fn_param_width/0.rs | 82 ++++--------------- tests/source/config/fn_param_width/100.rs | 52 +++++++++--- tests/source/config/fn_param_width/150.rs | 52 +++++++++--- tests/source/config/fn_param_width/50.rs | 52 +++++++++--- tests/target/config/fn_param_width/0.rs | 96 ++-------------------- tests/target/config/fn_param_width/100.rs | 61 ++++++++++---- tests/target/config/fn_param_width/150.rs | 45 +++++++++-- tests/target/config/fn_param_width/50.rs | 97 ++++++++++++++++++----- 13 files changed, 330 insertions(+), 254 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1eb55ff101..5f45e7dfc03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,9 +95,9 @@ checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bstr" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "serde", @@ -927,9 +927,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -942,45 +942,45 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" [[package]] name = "winnow" diff --git a/src/items.rs b/src/items.rs index 845de0209ce..ca6d8e2da8e 100644 --- a/src/items.rs +++ b/src/items.rs @@ -2353,13 +2353,7 @@ fn rewrite_fn_base( 2 }; let used_width = last_line_used_width(&result, indent.width()); - let one_line_budget = std::cmp::min( - context.budget(used_width + overhead), - context - .config - .fn_param_width() - .saturating_sub(used_width + overhead), - ); + let one_line_budget = context.budget(used_width + overhead); let shape = Shape { width: one_line_budget, indent, diff --git a/tests/config/fn_param_width/0.toml b/tests/config/fn_param_width/0.toml index 976448c21ea..38ccb867c22 100644 --- a/tests/config/fn_param_width/0.toml +++ b/tests/config/fn_param_width/0.toml @@ -1,2 +1 @@ -max_width = 100 fn_param_width = 0 \ No newline at end of file diff --git a/tests/config/fn_param_width/100.toml b/tests/config/fn_param_width/100.toml index 3ae9cc80aa3..25b7fc62dc2 100644 --- a/tests/config/fn_param_width/100.toml +++ b/tests/config/fn_param_width/100.toml @@ -1,2 +1 @@ -max_width = 100 fn_param_width = 100 \ No newline at end of file diff --git a/tests/config/fn_param_width/50.toml b/tests/config/fn_param_width/50.toml index 80e4fa3cd62..cfedf12adbe 100644 --- a/tests/config/fn_param_width/50.toml +++ b/tests/config/fn_param_width/50.toml @@ -1,2 +1 @@ -max_width = 50 fn_param_width = 50 \ No newline at end of file diff --git a/tests/source/config/fn_param_width/0.rs b/tests/source/config/fn_param_width/0.rs index 3e0456d80f1..f9388239d4c 100644 --- a/tests/source/config/fn_param_width/0.rs +++ b/tests/source/config/fn_param_width/0.rs @@ -1,93 +1,41 @@ // rustfmt-config: fn_param_width/0.toml - - -fn lorem(mut commands: Commands, icons: Res) { - // block -} - -fn ret(mut commands: Commands, icons: Res) -> bool { - // block -} - -unsafe fn lorem(mut commands: Commands, icons: Res) { - // block -} - -fn lagging(mut commands: Commands, icons: Res) { - // block -} - -pub fn public(mut commands: Commands, icons: Res) { - // block -} - -pub(super) fn up(mut commands: Commands, icons: Res) { - // block -} - -pub(crate) fn all(mut commands: Commands, icons: Res) { +fn lorem(mut commands: Commands) { // block } - -pub unsafe fn complicated(mut commands: Commands, icons: Res) { +fn lorem(mut commands: Commands, icons: Res) { // block } - -extern "C" { - fn foreign(mut commands: Commands, icons: Res) { - // block - } -} - -fn homura>(_: T) {} - -fn generic(query: Query) { +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block } - -pub fn setup_arena( - mut commands: Commands, - icons: Res, - mut meshes: ResMut>, - mut materials: ResMut>, - //models: Res, -) { +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>) { // block } -fn comments(mut commands: Commands, /* intermission */ icons: Res) { +fn comments(mut commands: Commands, /**/ icons: Res) { // block } -fn spacing(mut commands: Commands, icons: Res) { +fn comments(mut commands: Commands, /* really loooooong intermission */ icons: Res) { // block } impl Trait { + fn lorem(mut commands: Commands); fn lorem(mut commands: Commands, icons: Res); fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>); - fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>); - - fn lorem(mut commands: Commands) { - // block - } - fn lorem(mut commands: Commands, icons: Res) { - // block - } - fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - } - fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>) { - // block - } + fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, + ); } - - fn outer(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block - + fn inner(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block } @@ -100,4 +48,4 @@ mod example { // block } } -} \ No newline at end of file +} diff --git a/tests/source/config/fn_param_width/100.rs b/tests/source/config/fn_param_width/100.rs index 5107ac49561..9871950625e 100644 --- a/tests/source/config/fn_param_width/100.rs +++ b/tests/source/config/fn_param_width/100.rs @@ -1,17 +1,51 @@ // rustfmt-config: fn_param_width/100.toml +fn lorem(mut commands: Commands) { + // block +} +fn lorem(mut commands: Commands, icons: Res) { + // block +} +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block +} +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>) { + // block +} + +fn comments(mut commands: Commands, /**/ icons: Res) { + // block +} + +fn comments(mut commands: Commands, /* really loooooong intermission */ icons: Res) { + // block +} + impl Trait { - fn lorem(first: First, second: Second); - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter); - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter); + fn lorem(mut commands: Commands); + fn lorem(mut commands: Commands, icons: Res); + fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>); + fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, + ); +} - fn lorem(first: First, second: Second) { - // block - } - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter) { +fn outer(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + + fn inner(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block } - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter) { +} + +mod example { + fn mod_func(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block + fn nested(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + } } -} \ No newline at end of file +} diff --git a/tests/source/config/fn_param_width/150.rs b/tests/source/config/fn_param_width/150.rs index 1979a2ca9f2..c932e01e64b 100644 --- a/tests/source/config/fn_param_width/150.rs +++ b/tests/source/config/fn_param_width/150.rs @@ -1,17 +1,51 @@ // rustfmt-config: fn_param_width/150.toml +fn lorem(mut commands: Commands) { + // block +} +fn lorem(mut commands: Commands, icons: Res) { + // block +} +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block +} +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>) { + // block +} + +fn comments(mut commands: Commands, /**/ icons: Res) { + // block +} + +fn comments(mut commands: Commands, /* really loooooong intermission */ icons: Res) { + // block +} + impl Trait { - fn lorem(first: First, second: Second); - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter); - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter); + fn lorem(mut commands: Commands); + fn lorem(mut commands: Commands, icons: Res); + fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>); + fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, + ); +} - fn lorem(first: First, second: Second) { - // block - } - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter) { +fn outer(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + + fn inner(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block } - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter) { +} + +mod example { + fn mod_func(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block + fn nested(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + } } -} \ No newline at end of file +} diff --git a/tests/source/config/fn_param_width/50.rs b/tests/source/config/fn_param_width/50.rs index c17c4014fb2..0ec12a525e7 100644 --- a/tests/source/config/fn_param_width/50.rs +++ b/tests/source/config/fn_param_width/50.rs @@ -1,17 +1,51 @@ // rustfmt-config: fn_param_width/50.toml +fn lorem(mut commands: Commands) { + // block +} +fn lorem(mut commands: Commands, icons: Res) { + // block +} +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block +} +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>) { + // block +} + +fn comments(mut commands: Commands, /**/ icons: Res) { + // block +} + +fn comments(mut commands: Commands, /* really loooooong intermission */ icons: Res) { + // block +} + impl Trait { - fn lorem(first: First, second: Second); - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter); - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter); + fn lorem(mut commands: Commands); + fn lorem(mut commands: Commands, icons: Res); + fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>); + fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, + ); +} - fn lorem(first: First, second: Second) { - // block - } - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter) { +fn outer(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + + fn inner(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block } - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter) { +} + +mod example { + fn mod_func(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block + fn nested(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + } } -} \ No newline at end of file +} diff --git a/tests/target/config/fn_param_width/0.rs b/tests/target/config/fn_param_width/0.rs index 78c444e2351..6685c599c26 100644 --- a/tests/target/config/fn_param_width/0.rs +++ b/tests/target/config/fn_param_width/0.rs @@ -2,97 +2,41 @@ fn lorem( mut commands: Commands, - icons: Res, -) { - // block -} - -fn ret( - mut commands: Commands, - icons: Res, -) -> bool { - // block -} - -unsafe fn lorem( - mut commands: Commands, - icons: Res, -) { - // block -} - -fn lagging( - mut commands: Commands, - icons: Res, ) { // block } - -pub fn public( - mut commands: Commands, - icons: Res, -) { - // block -} - -pub(super) fn up( - mut commands: Commands, - icons: Res, -) { - // block -} - -pub(crate) fn all( +fn lorem( mut commands: Commands, icons: Res, ) { // block } - -pub unsafe fn complicated( +fn lorem( mut commands: Commands, icons: Res, + mut meshes: ResMut>, ) { // block } - -extern "C" { - fn foreign( - mut commands: Commands, - icons: Res, - ) { - // block - } -} - -fn homura>(_: T) {} - -fn generic( - query: Query, -) { - // block -} - -pub fn setup_arena( +fn lorem( mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>, - //models: Res, ) { // block } fn comments( mut commands: Commands, - /* intermission */ icons: Res, + /**/ icons: Res, ) { // block } -fn spacing( +fn comments( mut commands: Commands, - icons: Res, + /* really loooooong intermission */ icons: Res, ) { // block } @@ -100,46 +44,22 @@ fn spacing( impl Trait { fn lorem( mut commands: Commands, - icons: Res, ); fn lorem( mut commands: Commands, icons: Res, - mut meshes: ResMut>, ); fn lorem( mut commands: Commands, icons: Res, mut meshes: ResMut>, - mut materials: ResMut>, ); - - fn lorem( - mut commands: Commands, - ) { - // block - } - fn lorem( - mut commands: Commands, - icons: Res, - ) { - // block - } - fn lorem( - mut commands: Commands, - icons: Res, - mut meshes: ResMut>, - ) { - // block - } fn lorem( mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>, - ) { - // block - } + ); } fn outer( diff --git a/tests/target/config/fn_param_width/100.rs b/tests/target/config/fn_param_width/100.rs index f16269cb197..f19a8548c36 100644 --- a/tests/target/config/fn_param_width/100.rs +++ b/tests/target/config/fn_param_width/100.rs @@ -1,27 +1,56 @@ // rustfmt-config: fn_param_width/100.toml +fn lorem(mut commands: Commands) { + // block +} +fn lorem(mut commands: Commands, icons: Res) { + // block +} +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block +} +fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, +) { + // block +} + +fn comments(mut commands: Commands, /**/ icons: Res) { + // block +} + +fn comments(mut commands: Commands, /* really loooooong intermission */ icons: Res) { + // block +} + impl Trait { - fn lorem(first: First, second: Second); - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter); + fn lorem(mut commands: Commands); + fn lorem(mut commands: Commands, icons: Res); + fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>); fn lorem( - first: FirstParameter, - second: SecondParameter, - third: ThirdParameter, - fourth: FourthParameter, + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, ); +} - fn lorem(first: First, second: Second) { - // block - } - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter) { +fn outer(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + + fn inner(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block } - fn lorem( - first: FirstParameter, - second: SecondParameter, - third: ThirdParameter, - fourth: FourthParameter, - ) { +} + +mod example { + fn mod_func(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block + fn nested(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + } } } diff --git a/tests/target/config/fn_param_width/150.rs b/tests/target/config/fn_param_width/150.rs index a933acf0e3a..d2e0d4e0dbb 100644 --- a/tests/target/config/fn_param_width/150.rs +++ b/tests/target/config/fn_param_width/150.rs @@ -1,17 +1,46 @@ // rustfmt-config: fn_param_width/150.toml +fn lorem(mut commands: Commands) { + // block +} +fn lorem(mut commands: Commands, icons: Res) { + // block +} +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block +} +fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>) { + // block +} + +fn comments(mut commands: Commands, /**/ icons: Res) { + // block +} + +fn comments(mut commands: Commands, /* really loooooong intermission */ icons: Res) { + // block +} + impl Trait { - fn lorem(first: First, second: Second); - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter); - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter); + fn lorem(mut commands: Commands); + fn lorem(mut commands: Commands, icons: Res); + fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>); + fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>); +} - fn lorem(first: First, second: Second) { - // block - } - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter) { +fn outer(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + + fn inner(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block } - fn lorem(first: FirstParameter, second: SecondParameter, third: ThirdParameter, fourth: FourthParameter) { +} + +mod example { + fn mod_func(mut commands: Commands, icons: Res, mut meshes: ResMut>) { // block + fn nested(mut commands: Commands, icons: Res, mut meshes: ResMut>) { + // block + } } } diff --git a/tests/target/config/fn_param_width/50.rs b/tests/target/config/fn_param_width/50.rs index 6d7b9ecc1eb..be78aea062f 100644 --- a/tests/target/config/fn_param_width/50.rs +++ b/tests/target/config/fn_param_width/50.rs @@ -1,35 +1,92 @@ // rustfmt-config: fn_param_width/50.toml +fn lorem(mut commands: Commands) { + // block +} +fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} +fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, +) { + // block +} +fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, +) { + // block +} + +fn comments( + mut commands: Commands, + /**/ icons: Res, +) { + // block +} + +fn comments( + mut commands: Commands, + /* really loooooong intermission */ icons: Res, +) { + // block +} + impl Trait { - fn lorem(first: First, second: Second); + fn lorem(mut commands: Commands); fn lorem( - first: FirstParameter, - second: SecondParameter, - third: ThirdParameter, + mut commands: Commands, + icons: Res, ); fn lorem( - first: FirstParameter, - second: SecondParameter, - third: ThirdParameter, - fourth: FourthParameter, + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, ); - - fn lorem(first: First, second: Second) { - // block - } fn lorem( - first: FirstParameter, - second: SecondParameter, - third: ThirdParameter, + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, + ); +} + +fn outer( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, +) { + // block + + fn inner( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, ) { // block } - fn lorem( - first: FirstParameter, - second: SecondParameter, - third: ThirdParameter, - fourth: FourthParameter, +} + +mod example { + fn mod_func( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, ) { // block + fn nested( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + ) { + // block + } } } From 7e4ab07d3206402ac7884d569d6e373b9e1507be Mon Sep 17 00:00:00 2001 From: Sjael Date: Mon, 26 Feb 2024 16:43:22 -0800 Subject: [PATCH 5/7] width limit -> # limit --- Cargo.lock | 4 +- Configurations.md | 23 ++- src/config/config_type.rs | 10 -- src/config/mod.rs | 8 +- src/config/options.rs | 5 - src/items.rs | 11 +- tests/config/fn_param_width/0.toml | 1 - tests/config/fn_param_width/100.toml | 1 - tests/config/fn_param_width/150.toml | 2 - tests/config/fn_param_width/50.toml | 1 - .../{fn_param_width => fn_param_limit}/0.rs | 46 +++++- .../100.rs => fn_param_limit/1.rs} | 46 +++++- .../150.rs => fn_param_limit/2.rs} | 48 ++++++- tests/source/config/fn_param_width/50.rs | 51 ------- .../50.rs => fn_param_limit/0.rs} | 88 +++++++++++- .../0.rs => fn_param_limit/1.rs} | 85 ++++++++++- tests/target/config/fn_param_limit/2.rs | 136 ++++++++++++++++++ tests/target/config/fn_param_width/100.rs | 56 -------- tests/target/config/fn_param_width/150.rs | 46 ------ 19 files changed, 465 insertions(+), 203 deletions(-) delete mode 100644 tests/config/fn_param_width/0.toml delete mode 100644 tests/config/fn_param_width/100.toml delete mode 100644 tests/config/fn_param_width/150.toml delete mode 100644 tests/config/fn_param_width/50.toml rename tests/source/config/{fn_param_width => fn_param_limit}/0.rs (60%) rename tests/source/config/{fn_param_width/100.rs => fn_param_limit/1.rs} (60%) rename tests/source/config/{fn_param_width/150.rs => fn_param_limit/2.rs} (56%) delete mode 100644 tests/source/config/fn_param_width/50.rs rename tests/target/config/{fn_param_width/50.rs => fn_param_limit/0.rs} (58%) rename tests/target/config/{fn_param_width/0.rs => fn_param_limit/1.rs} (62%) create mode 100644 tests/target/config/fn_param_limit/2.rs delete mode 100644 tests/target/config/fn_param_width/100.rs delete mode 100644 tests/target/config/fn_param_width/150.rs diff --git a/Cargo.lock b/Cargo.lock index 5f45e7dfc03..7a43e22b2d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -688,9 +688,9 @@ checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "syn" -version = "2.0.50" +version = "2.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" dependencies = [ "proc-macro2", "quote", diff --git a/Configurations.md b/Configurations.md index 8043aff7d05..e2b374ec32b 100644 --- a/Configurations.md +++ b/Configurations.md @@ -766,20 +766,29 @@ Maximum width of the args of a function call before falling back to vertical for By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_call_width` will take precedence. -See also [`fn_param_width`](#fn_param_width), [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics) +See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics) -## `fn_param_width` +## `enable_fn_param_limit` -Maximum width of the declaration of a function signature before falling back to formatting chosen with `fn_param_layout`. +Switch to enable the unstable feature `fn_param_limit`. -- **Default value**: `100` -- **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width) +- **Default value**: `false` +- **Possible values**: `true`, `false` - **Stable**: No -By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_param_width` will take precedence. +See also [`fn_param_limit`](#fn_param_limit) -See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics) + +## `fn_param_limit` + +Maximum parameters in the declaration of a function signature before falling back to formatting chosen with `fn_param_layout`. + +- **Default value**: `4` +- **Possible values**: any non-negative integer +- **Stable**: No + +See also [`enable_fn_param_limit`](#enable_fn_param_limit) and [`fn_params_layout`](#fn_params_layout) ## `fn_params_layout` diff --git a/src/config/config_type.rs b/src/config/config_type.rs index deabea01d2e..f7cff1a1729 100644 --- a/src/config/config_type.rs +++ b/src/config/config_type.rs @@ -122,7 +122,6 @@ macro_rules! create_config { | "fn_call_width" | "single_line_if_else_max_width" | "single_line_let_else_max_width" - | "fn_param_width" | "attr_fn_like_width" | "struct_lit_width" | "struct_variant_width" @@ -274,7 +273,6 @@ macro_rules! create_config { | "fn_call_width" | "single_line_if_else_max_width" | "single_line_let_else_max_width" - | "fn_param_width" | "attr_fn_like_width" | "struct_lit_width" | "struct_variant_width" @@ -423,14 +421,6 @@ macro_rules! create_config { "single_line_let_else_max_width", ); self.single_line_let_else_max_width.2 = single_line_let_else_max_width; - - let fn_param_width = get_width_value( - self.was_set().fn_param_width(), - self.fn_param_width.2, - heuristics.fn_param_width, - "fn_param_width", - ); - self.fn_param_width.2 = fn_param_width; } fn set_heuristics(&mut self) { diff --git a/src/config/mod.rs b/src/config/mod.rs index 04aeb55452a..e7366a10981 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -61,7 +61,6 @@ create_config! { single_line_let_else_max_width: usize, 50, true, "Maximum line length for single line \ let-else statements. A value of zero means always format the divergent `else` block \ over multiple lines."; - fn_param_width: usize, 100, false, "Maximum line length for function declarations."; // Comments. macros, and strings wrap_comments: bool, false, false, "Break comments to fit on the line"; @@ -88,6 +87,9 @@ create_config! { "Put small struct literals on a single line"; fn_single_line: bool, false, false, "Put single-expression functions on a single line"; where_single_line: bool, false, false, "Force where-clauses to be on a single line"; + enable_fn_param_limit: bool, false, false, "Switch to enable `fn_param_limit`"; + fn_param_limit: usize, 4, false, "How many parameters in a function declaration before \ + falling back to formatting chosen with `fn_param_layout`"; // Imports imports_indent: IndentStyle, IndentStyle::Block, false, "Indent of imports"; @@ -491,7 +493,6 @@ mod test { single_line_let_else_max_width: usize, 50, false, "Maximum line length for single \ line let-else statements. A value of zero means always format the divergent \ `else` block over multiple lines."; - fn_param_width: usize, 100, true, "Maximum line length for function declarations."; // Options that are used by the tests stable_option: bool, false, true, "A stable option"; @@ -636,7 +637,6 @@ array_width = 60 chain_width = 60 single_line_if_else_max_width = 50 single_line_let_else_max_width = 50 -fn_param_width = 100 wrap_comments = false format_code_in_doc_comments = false doc_comment_code_block_width = 100 @@ -652,6 +652,8 @@ empty_item_single_line = true struct_lit_single_line = true fn_single_line = false where_single_line = false +enable_fn_param_limit = false +fn_param_limit = 4 imports_indent = "Block" imports_layout = "Mixed" imports_granularity = "Preserve" diff --git a/src/config/options.rs b/src/config/options.rs index 50f903ca71b..3c5c713a33a 100644 --- a/src/config/options.rs +++ b/src/config/options.rs @@ -241,8 +241,6 @@ pub struct WidthHeuristics { // Maximum line length for single line let-else statements. A value of zero means // always format the divergent `else` block over multiple lines. pub(crate) single_line_let_else_max_width: usize, - // Maximum line length for function declarations. - pub(crate) fn_param_width: usize, } impl fmt::Display for WidthHeuristics { @@ -263,7 +261,6 @@ impl WidthHeuristics { chain_width: usize::max_value(), single_line_if_else_max_width: 0, single_line_let_else_max_width: 0, - fn_param_width: usize::max_value(), } } @@ -277,7 +274,6 @@ impl WidthHeuristics { chain_width: max_width, single_line_if_else_max_width: max_width, single_line_let_else_max_width: max_width, - fn_param_width: max_width, } } @@ -300,7 +296,6 @@ impl WidthHeuristics { chain_width: (60.0 * max_width_ratio).round() as usize, single_line_if_else_max_width: (50.0 * max_width_ratio).round() as usize, single_line_let_else_max_width: (50.0 * max_width_ratio).round() as usize, - fn_param_width: (100.0 * max_width_ratio).round() as usize, } } } diff --git a/src/items.rs b/src/items.rs index ca6d8e2da8e..7d845fc2a4e 100644 --- a/src/items.rs +++ b/src/items.rs @@ -2390,6 +2390,7 @@ fn rewrite_fn_base( ret_str_len, fn_brace_style, multi_line_ret_str, + fd.inputs.len(), )?; debug!( @@ -2779,6 +2780,7 @@ fn compute_budgets_for_params( ret_str_len: usize, fn_brace_style: FnBraceStyle, force_vertical_layout: bool, + param_count: usize, ) -> Option<(usize, usize, Indent)> { debug!( "compute_budgets_for_params {} {:?}, {}, {:?}", @@ -2787,8 +2789,10 @@ fn compute_budgets_for_params( ret_str_len, fn_brace_style, ); + let over_param_limit = + context.config.enable_fn_param_limit() && param_count > context.config.fn_param_limit(); // Try keeping everything on the same line. - if !result.contains('\n') && !force_vertical_layout { + if !result.contains('\n') && !force_vertical_layout && !over_param_limit { // 2 = `()`, 3 = `() `, space is before ret_string. let overhead = if ret_str_len == 0 { 2 } else { 3 }; let mut used_space = indent.width() + result.len() + ret_str_len + overhead; @@ -2797,10 +2801,7 @@ fn compute_budgets_for_params( FnBraceStyle::SameLine => used_space += 2, // 2 = `{}` FnBraceStyle::NextLine => (), } - let one_line_budget = std::cmp::min( - context.budget(used_space), - context.config.fn_param_width().saturating_sub(used_space), - ); + let one_line_budget = context.budget(used_space); if one_line_budget > 0 { // 4 = "() {".len() diff --git a/tests/config/fn_param_width/0.toml b/tests/config/fn_param_width/0.toml deleted file mode 100644 index 38ccb867c22..00000000000 --- a/tests/config/fn_param_width/0.toml +++ /dev/null @@ -1 +0,0 @@ -fn_param_width = 0 \ No newline at end of file diff --git a/tests/config/fn_param_width/100.toml b/tests/config/fn_param_width/100.toml deleted file mode 100644 index 25b7fc62dc2..00000000000 --- a/tests/config/fn_param_width/100.toml +++ /dev/null @@ -1 +0,0 @@ -fn_param_width = 100 \ No newline at end of file diff --git a/tests/config/fn_param_width/150.toml b/tests/config/fn_param_width/150.toml deleted file mode 100644 index 46a847f5ce3..00000000000 --- a/tests/config/fn_param_width/150.toml +++ /dev/null @@ -1,2 +0,0 @@ -max_width = 150 -fn_param_width = 150 \ No newline at end of file diff --git a/tests/config/fn_param_width/50.toml b/tests/config/fn_param_width/50.toml deleted file mode 100644 index cfedf12adbe..00000000000 --- a/tests/config/fn_param_width/50.toml +++ /dev/null @@ -1 +0,0 @@ -fn_param_width = 50 \ No newline at end of file diff --git a/tests/source/config/fn_param_width/0.rs b/tests/source/config/fn_param_limit/0.rs similarity index 60% rename from tests/source/config/fn_param_width/0.rs rename to tests/source/config/fn_param_limit/0.rs index f9388239d4c..520a98fc910 100644 --- a/tests/source/config/fn_param_width/0.rs +++ b/tests/source/config/fn_param_limit/0.rs @@ -1,4 +1,6 @@ -// rustfmt-config: fn_param_width/0.toml +// rustfmt-enable_fn_param_limit: true +// rustfmt-fn_param_limit: 0 +// rustfmt-edition: 2018 fn lorem(mut commands: Commands) { // block @@ -21,6 +23,48 @@ fn comments(mut commands: Commands, /* really loooooong intermission */ icons: R // block } +fn generic(query: Query, query2: Query) { + // block +} + +fn lorem(query: Query) where C: Add + Sub + Mul + Div { + // body +} + +fn lorem(query: Query, mut commands: Commands, icons: Res) where C: Add + Sub + Mul + Div { + // body +} + +fn lorem(mut commands: Commands, icons: Res) -> bool { + // block +} + +pub fn lorem(mut commands: Commands, icons: Res) { + // block +} + +pub(crate) fn lorem(mut commands: Commands, icons: Res) { + // block +} + +pub(super) fn lorem(mut commands: Commands, icons: Res) { + // block +} + +async fn lorem(mut commands: Commands, icons: Res) { + // block +} + +unsafe fn lorem(mut commands: Commands, icons: Res) { + // block +} + +extern "C" { + fn lorem(mut commands: Commands, icons: Res) { + // block + } +} + impl Trait { fn lorem(mut commands: Commands); fn lorem(mut commands: Commands, icons: Res); diff --git a/tests/source/config/fn_param_width/100.rs b/tests/source/config/fn_param_limit/1.rs similarity index 60% rename from tests/source/config/fn_param_width/100.rs rename to tests/source/config/fn_param_limit/1.rs index 9871950625e..008239c51bd 100644 --- a/tests/source/config/fn_param_width/100.rs +++ b/tests/source/config/fn_param_limit/1.rs @@ -1,4 +1,6 @@ -// rustfmt-config: fn_param_width/100.toml +// rustfmt-enable_fn_param_limit: true +// rustfmt-fn_param_limit: 1 +// rustfmt-edition: 2018 fn lorem(mut commands: Commands) { // block @@ -21,6 +23,48 @@ fn comments(mut commands: Commands, /* really loooooong intermission */ icons: R // block } +fn generic(query: Query, query2: Query) { + // block +} + +fn lorem(query: Query) where C: Add + Sub + Mul + Div { + // body +} + +fn lorem(query: Query, mut commands: Commands, icons: Res) where C: Add + Sub + Mul + Div { + // body +} + +fn lorem(mut commands: Commands, icons: Res) -> bool { + // block +} + +pub fn lorem(mut commands: Commands, icons: Res) { + // block +} + +pub(crate) fn lorem(mut commands: Commands, icons: Res) { + // block +} + +pub(super) fn lorem(mut commands: Commands, icons: Res) { + // block +} + +async fn lorem(mut commands: Commands, icons: Res) { + // block +} + +unsafe fn lorem(mut commands: Commands, icons: Res) { + // block +} + +extern "C" { + fn lorem(mut commands: Commands, icons: Res) { + // block + } +} + impl Trait { fn lorem(mut commands: Commands); fn lorem(mut commands: Commands, icons: Res); diff --git a/tests/source/config/fn_param_width/150.rs b/tests/source/config/fn_param_limit/2.rs similarity index 56% rename from tests/source/config/fn_param_width/150.rs rename to tests/source/config/fn_param_limit/2.rs index c932e01e64b..3343f22fd8b 100644 --- a/tests/source/config/fn_param_width/150.rs +++ b/tests/source/config/fn_param_limit/2.rs @@ -1,4 +1,6 @@ -// rustfmt-config: fn_param_width/150.toml +// rustfmt-enable_fn_param_limit: true +// rustfmt-fn_param_limit: 2 +// rustfmt-edition: 2018 fn lorem(mut commands: Commands) { // block @@ -17,10 +19,52 @@ fn comments(mut commands: Commands, /**/ icons: Res) { // block } -fn comments(mut commands: Commands, /* really loooooong intermission */ icons: Res) { +fn comments(mut commands: Commands, /* really really loooooooong intermission */ icons: Res) { // block } +fn generic(query: Query, query2: Query) { + // block +} + +fn lorem(query: Query) where C: Add + Sub + Mul + Div { + // body +} + +fn lorem(query: Query, mut commands: Commands, icons: Res) where C: Add + Sub + Mul + Div { + // body +} + +fn lorem(mut commands: Commands, icons: Res) -> bool { + // block +} + +pub fn lorem(mut commands: Commands, icons: Res) { + // block +} + +pub(crate) fn lorem(mut commands: Commands, icons: Res) { + // block +} + +pub(super) fn lorem(mut commands: Commands, icons: Res) { + // block +} + +async fn lorem(mut commands: Commands, icons: Res) { + // block +} + +unsafe fn lorem(mut commands: Commands, icons: Res) { + // block +} + +extern "C" { + fn lorem(mut commands: Commands, icons: Res) { + // block + } +} + impl Trait { fn lorem(mut commands: Commands); fn lorem(mut commands: Commands, icons: Res); diff --git a/tests/source/config/fn_param_width/50.rs b/tests/source/config/fn_param_width/50.rs deleted file mode 100644 index 0ec12a525e7..00000000000 --- a/tests/source/config/fn_param_width/50.rs +++ /dev/null @@ -1,51 +0,0 @@ -// rustfmt-config: fn_param_width/50.toml - -fn lorem(mut commands: Commands) { - // block -} -fn lorem(mut commands: Commands, icons: Res) { - // block -} -fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block -} -fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>) { - // block -} - -fn comments(mut commands: Commands, /**/ icons: Res) { - // block -} - -fn comments(mut commands: Commands, /* really loooooong intermission */ icons: Res) { - // block -} - -impl Trait { - fn lorem(mut commands: Commands); - fn lorem(mut commands: Commands, icons: Res); - fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>); - fn lorem( - mut commands: Commands, - icons: Res, - mut meshes: ResMut>, - mut materials: ResMut>, - ); -} - -fn outer(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - - fn inner(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - } -} - -mod example { - fn mod_func(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - fn nested(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - } - } -} diff --git a/tests/target/config/fn_param_width/50.rs b/tests/target/config/fn_param_limit/0.rs similarity index 58% rename from tests/target/config/fn_param_width/50.rs rename to tests/target/config/fn_param_limit/0.rs index be78aea062f..fcb2fea368a 100644 --- a/tests/target/config/fn_param_width/50.rs +++ b/tests/target/config/fn_param_limit/0.rs @@ -1,6 +1,10 @@ -// rustfmt-config: fn_param_width/50.toml +// rustfmt-enable_fn_param_limit: true +// rustfmt-fn_param_limit: 0 +// rustfmt-edition: 2018 -fn lorem(mut commands: Commands) { +fn lorem( + mut commands: Commands, +) { // block } fn lorem( @@ -39,8 +43,86 @@ fn comments( // block } +fn generic( + query: Query, + query2: Query, +) { + // block +} + +fn lorem( + query: Query, +) where + C: Add + Sub + Mul + Div, +{ + // body +} + +fn lorem( + query: Query, + mut commands: Commands, + icons: Res, +) where + C: Add + Sub + Mul + Div, +{ + // body +} + +fn lorem( + mut commands: Commands, + icons: Res, +) -> bool { + // block +} + +pub fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +pub(crate) fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +pub(super) fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +async fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +unsafe fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +extern "C" { + fn lorem( + mut commands: Commands, + icons: Res, + ) { + // block + } +} + impl Trait { - fn lorem(mut commands: Commands); + fn lorem( + mut commands: Commands, + ); fn lorem( mut commands: Commands, icons: Res, diff --git a/tests/target/config/fn_param_width/0.rs b/tests/target/config/fn_param_limit/1.rs similarity index 62% rename from tests/target/config/fn_param_width/0.rs rename to tests/target/config/fn_param_limit/1.rs index 6685c599c26..48d36ae0694 100644 --- a/tests/target/config/fn_param_width/0.rs +++ b/tests/target/config/fn_param_limit/1.rs @@ -1,8 +1,8 @@ -// rustfmt-config: fn_param_width/0.toml +// rustfmt-enable_fn_param_limit: true +// rustfmt-fn_param_limit: 1 +// rustfmt-edition: 2018 -fn lorem( - mut commands: Commands, -) { +fn lorem(mut commands: Commands) { // block } fn lorem( @@ -41,10 +41,83 @@ fn comments( // block } -impl Trait { +fn generic( + query: Query, + query2: Query, +) { + // block +} + +fn lorem(query: Query) +where + C: Add + Sub + Mul + Div, +{ + // body +} + +fn lorem( + query: Query, + mut commands: Commands, + icons: Res, +) where + C: Add + Sub + Mul + Div, +{ + // body +} + +fn lorem( + mut commands: Commands, + icons: Res, +) -> bool { + // block +} + +pub fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +pub(crate) fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +pub(super) fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +async fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +unsafe fn lorem( + mut commands: Commands, + icons: Res, +) { + // block +} + +extern "C" { fn lorem( mut commands: Commands, - ); + icons: Res, + ) { + // block + } +} + +impl Trait { + fn lorem(mut commands: Commands); fn lorem( mut commands: Commands, icons: Res, diff --git a/tests/target/config/fn_param_limit/2.rs b/tests/target/config/fn_param_limit/2.rs new file mode 100644 index 00000000000..15be800b665 --- /dev/null +++ b/tests/target/config/fn_param_limit/2.rs @@ -0,0 +1,136 @@ +// rustfmt-enable_fn_param_limit: true +// rustfmt-fn_param_limit: 2 +// rustfmt-edition: 2018 + +fn lorem(mut commands: Commands) { + // block +} +fn lorem(mut commands: Commands, icons: Res) { + // block +} +fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, +) { + // block +} +fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, +) { + // block +} + +fn comments(mut commands: Commands, /**/ icons: Res) { + // block +} + +fn comments( + mut commands: Commands, + /* really really loooooooong intermission */ icons: Res, +) { + // block +} + +fn generic(query: Query, query2: Query) { + // block +} + +fn lorem(query: Query) +where + C: Add + Sub + Mul + Div, +{ + // body +} + +fn lorem( + query: Query, + mut commands: Commands, + icons: Res, +) where + C: Add + Sub + Mul + Div, +{ + // body +} + +fn lorem(mut commands: Commands, icons: Res) -> bool { + // block +} + +pub fn lorem(mut commands: Commands, icons: Res) { + // block +} + +pub(crate) fn lorem(mut commands: Commands, icons: Res) { + // block +} + +pub(super) fn lorem(mut commands: Commands, icons: Res) { + // block +} + +async fn lorem(mut commands: Commands, icons: Res) { + // block +} + +unsafe fn lorem(mut commands: Commands, icons: Res) { + // block +} + +extern "C" { + fn lorem(mut commands: Commands, icons: Res) { + // block + } +} + +impl Trait { + fn lorem(mut commands: Commands); + fn lorem(mut commands: Commands, icons: Res); + fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + ); + fn lorem( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + mut materials: ResMut>, + ); +} + +fn outer( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, +) { + // block + + fn inner( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + ) { + // block + } +} + +mod example { + fn mod_func( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + ) { + // block + fn nested( + mut commands: Commands, + icons: Res, + mut meshes: ResMut>, + ) { + // block + } + } +} diff --git a/tests/target/config/fn_param_width/100.rs b/tests/target/config/fn_param_width/100.rs deleted file mode 100644 index f19a8548c36..00000000000 --- a/tests/target/config/fn_param_width/100.rs +++ /dev/null @@ -1,56 +0,0 @@ -// rustfmt-config: fn_param_width/100.toml - -fn lorem(mut commands: Commands) { - // block -} -fn lorem(mut commands: Commands, icons: Res) { - // block -} -fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block -} -fn lorem( - mut commands: Commands, - icons: Res, - mut meshes: ResMut>, - mut materials: ResMut>, -) { - // block -} - -fn comments(mut commands: Commands, /**/ icons: Res) { - // block -} - -fn comments(mut commands: Commands, /* really loooooong intermission */ icons: Res) { - // block -} - -impl Trait { - fn lorem(mut commands: Commands); - fn lorem(mut commands: Commands, icons: Res); - fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>); - fn lorem( - mut commands: Commands, - icons: Res, - mut meshes: ResMut>, - mut materials: ResMut>, - ); -} - -fn outer(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - - fn inner(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - } -} - -mod example { - fn mod_func(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - fn nested(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - } - } -} diff --git a/tests/target/config/fn_param_width/150.rs b/tests/target/config/fn_param_width/150.rs deleted file mode 100644 index d2e0d4e0dbb..00000000000 --- a/tests/target/config/fn_param_width/150.rs +++ /dev/null @@ -1,46 +0,0 @@ -// rustfmt-config: fn_param_width/150.toml - -fn lorem(mut commands: Commands) { - // block -} -fn lorem(mut commands: Commands, icons: Res) { - // block -} -fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block -} -fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>) { - // block -} - -fn comments(mut commands: Commands, /**/ icons: Res) { - // block -} - -fn comments(mut commands: Commands, /* really loooooong intermission */ icons: Res) { - // block -} - -impl Trait { - fn lorem(mut commands: Commands); - fn lorem(mut commands: Commands, icons: Res); - fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>); - fn lorem(mut commands: Commands, icons: Res, mut meshes: ResMut>, mut materials: ResMut>); -} - -fn outer(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - - fn inner(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - } -} - -mod example { - fn mod_func(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - fn nested(mut commands: Commands, icons: Res, mut meshes: ResMut>) { - // block - } - } -} From 118e6ecbc5ba61c7f3dbeb95f39d75e2a15a5017 Mon Sep 17 00:00:00 2001 From: Sjael Date: Mon, 26 Feb 2024 16:59:33 -0800 Subject: [PATCH 6/7] checks work? plz? --- tests/source/{config => }/fn_param_limit/0.rs | 0 tests/source/{config => }/fn_param_limit/1.rs | 0 tests/source/{config => }/fn_param_limit/2.rs | 0 tests/target/{config => }/fn_param_limit/0.rs | 0 tests/target/{config => }/fn_param_limit/1.rs | 0 tests/target/{config => }/fn_param_limit/2.rs | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename tests/source/{config => }/fn_param_limit/0.rs (100%) rename tests/source/{config => }/fn_param_limit/1.rs (100%) rename tests/source/{config => }/fn_param_limit/2.rs (100%) rename tests/target/{config => }/fn_param_limit/0.rs (100%) rename tests/target/{config => }/fn_param_limit/1.rs (100%) rename tests/target/{config => }/fn_param_limit/2.rs (100%) diff --git a/tests/source/config/fn_param_limit/0.rs b/tests/source/fn_param_limit/0.rs similarity index 100% rename from tests/source/config/fn_param_limit/0.rs rename to tests/source/fn_param_limit/0.rs diff --git a/tests/source/config/fn_param_limit/1.rs b/tests/source/fn_param_limit/1.rs similarity index 100% rename from tests/source/config/fn_param_limit/1.rs rename to tests/source/fn_param_limit/1.rs diff --git a/tests/source/config/fn_param_limit/2.rs b/tests/source/fn_param_limit/2.rs similarity index 100% rename from tests/source/config/fn_param_limit/2.rs rename to tests/source/fn_param_limit/2.rs diff --git a/tests/target/config/fn_param_limit/0.rs b/tests/target/fn_param_limit/0.rs similarity index 100% rename from tests/target/config/fn_param_limit/0.rs rename to tests/target/fn_param_limit/0.rs diff --git a/tests/target/config/fn_param_limit/1.rs b/tests/target/fn_param_limit/1.rs similarity index 100% rename from tests/target/config/fn_param_limit/1.rs rename to tests/target/fn_param_limit/1.rs diff --git a/tests/target/config/fn_param_limit/2.rs b/tests/target/fn_param_limit/2.rs similarity index 100% rename from tests/target/config/fn_param_limit/2.rs rename to tests/target/fn_param_limit/2.rs From 9d1d649409bce3fefb5ee97b8ce3b6f5cb74f552 Mon Sep 17 00:00:00 2001 From: Sjael Date: Mon, 26 Feb 2024 17:05:51 -0800 Subject: [PATCH 7/7] restore cargo.lock --- Cargo.lock | 395 ++++++++++++++++++++++++----------------------------- 1 file changed, 175 insertions(+), 220 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7a43e22b2d5..ee396cce26a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.1.2" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] [[package]] name = "annotate-snippets" -version = "0.9.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e" +checksum = "c3b9d411ecbaf79885c6df4d75fff75858d5995ff25385657a28af47e82f9c36" dependencies = [ "unicode-width", "yansi-term", @@ -23,9 +23,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.12" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" dependencies = [ "anstyle", "anstyle-parse", @@ -37,33 +37,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" dependencies = [ "anstyle", "windows-sys", @@ -71,9 +71,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" [[package]] name = "autocfg" @@ -87,45 +87,38 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - [[package]] name = "bstr" -version = "1.9.1" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ "memchr", - "serde", ] [[package]] name = "bytecount" -version = "0.6.7" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" +checksum = "ad152d03a2c813c80bb94fedbf3a3f02b28f793e39e7c214c8a0bcc196343de7" dependencies = [ "packed_simd", ] [[package]] name = "camino" -version = "1.1.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "6f3132262930b0522068049f5870a856ab8affc80c70d08b6ecb785771a6fc23" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.7" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" dependencies = [ "serde", ] @@ -152,9 +145,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.1" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" dependencies = [ "clap_builder", "clap_derive", @@ -172,9 +165,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" dependencies = [ "anstream", "anstyle", @@ -184,9 +177,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", @@ -196,9 +189,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "colorchoice" @@ -207,35 +200,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" +name = "crossbeam-utils" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ - "crossbeam-utils", + "cfg-if", + "lazy_static", ] -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - [[package]] name = "diff" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" +checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" [[package]] name = "dirs" @@ -280,15 +258,15 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] -name = "equivalent" -version = "1.0.1" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "getopts" @@ -301,9 +279,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if", "libc", @@ -312,52 +290,54 @@ dependencies = [ [[package]] name = "globset" -version = "0.4.14" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" dependencies = [ "aho-corasick", "bstr", + "fnv", "log", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex", ] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "heck" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "ignore" -version = "0.4.22" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" dependencies = [ - "crossbeam-deque", + "crossbeam-utils", "globset", + "lazy_static", "log", "memchr", - "regex-automata 0.4.5", + "regex", "same-file", + "thread_local", "walkdir", "winapi-util", ] [[package]] name = "indexmap" -version = "2.2.3" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "equivalent", + "autocfg", "hashbrown", ] @@ -372,9 +352,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "lazy_static" @@ -384,9 +364,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" [[package]] name = "libm" @@ -395,36 +375,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "libredox" -version = "0.0.1" +name = "log" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ - "bitflags 2.4.2", - "libc", - "redox_syscall", + "cfg-if", ] -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - [[package]] name = "matchers" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata 0.1.10", + "regex-automata", ] [[package]] name = "memchr" -version = "2.7.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "nu-ansi-term" @@ -438,9 +410,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -448,9 +420,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "overload" @@ -470,58 +442,57 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", - "libredox", + "redox_syscall", "thiserror", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] @@ -530,18 +501,7 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] @@ -550,12 +510,6 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - [[package]] name = "rustfmt-config_proc_macro" version = "0.3.0" @@ -597,15 +551,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "same-file" @@ -618,27 +572,27 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.197" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", @@ -647,9 +601,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa", "ryu", @@ -658,39 +612,39 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" dependencies = [ "serde", ] [[package]] name = "sharded-slab" -version = "0.1.7" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] [[package]] name = "smallvec" -version = "1.13.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "strsim" -version = "0.11.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "2.0.51" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" +checksum = "fcf316d5356ed6847742d036f8a39c3b8435cac10bd528a4bd461928a6ab34d5" dependencies = [ "proc-macro2", "quote", @@ -710,18 +664,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", @@ -730,19 +684,18 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ - "cfg-if", "once_cell", ] [[package]] name = "toml" -version = "0.7.8" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" dependencies = [ "serde", "serde_spanned", @@ -752,18 +705,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.19.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" dependencies = [ "indexmap", "serde", @@ -774,10 +727,11 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -785,9 +739,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", @@ -796,9 +750,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", @@ -806,20 +760,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.2.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ + "lazy_static", "log", - "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ "matchers", "nu-ansi-term", @@ -835,27 +789,27 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-properties" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" +checksum = "c7f91c8b21fbbaa18853c3d0801c78f4fc94cdb976699bb03e832e75f7fd22f0" [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "utf8parse" @@ -871,19 +825,20 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", + "winapi", "winapi-util", ] [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "winapi" @@ -903,9 +858,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ "winapi", ] @@ -918,18 +873,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -942,51 +897,51 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.5.40" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" dependencies = [ "memchr", ]