summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/width-heuristics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/target/width-heuristics.rs')
-rw-r--r--src/tools/rustfmt/tests/target/width-heuristics.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/width-heuristics.rs b/src/tools/rustfmt/tests/target/width-heuristics.rs
new file mode 100644
index 000000000..e177a2152
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/width-heuristics.rs
@@ -0,0 +1,24 @@
+// rustfmt-max_width: 120
+
+// elems on multiple lines for max_width 100, but same line for max_width 120
+fn foo(e: Enum) {
+ match e {
+ Enum::Var { elem1, elem2, elem3 } => {
+ return;
+ }
+ }
+}
+
+// elems not on same line for either max_width 100 or 120
+fn bar(e: Enum) {
+ match e {
+ Enum::Var {
+ elem1,
+ elem2,
+ elem3,
+ elem4,
+ } => {
+ return;
+ }
+ }
+}