rust/tests/source/issue-1127.rs
Marcus Ball b8da53ad78 Fix wrap_match_arms resulting in a missing comma (#1307)
* Fix match arms missing comma with "wrap_match_arms = false"

* remove assert; use body_suffix for comma

* basic test case for issue 1127
2017-03-01 09:46:10 +13:00

24 lines
773 B
Rust

// rustfmt-max_width:120
// rustfmt-wrap_match_arms: false
// rustfmt-match_block_trailing_comma: true
fn a_very_very_very_very_very_very_very_very_very_very_very_long_function_name() -> i32 {
42
}
enum TestEnum {
AVeryVeryLongEnumName,
AnotherVeryLongEnumName,
TheLastVeryLongEnumName,
}
fn main() {
let var = TestEnum::AVeryVeryLongEnumName;
let num = match var {
TestEnum::AVeryVeryLongEnumName => a_very_very_very_very_very_very_very_very_very_very_very_long_function_name(),
TestEnum::AnotherVeryLongEnumName => a_very_very_very_very_very_very_very_very_very_very_very_long_function_name(),
TestEnum::TheLastVeryLongEnumName => a_very_very_very_very_very_very_very_very_very_very_very_long_function_name(),
};
}