Merge pull request #1488 from topecongiro/long-match-arm
Use block when arm exceeds max_width
This commit is contained in:
commit
c68e5a8e37
@ -1356,7 +1356,9 @@ fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
|
||||
};
|
||||
|
||||
match rewrite {
|
||||
Some(ref body_str) if !body_str.contains('\n') || !context.config.wrap_match_arms ||
|
||||
Some(ref body_str) if (!body_str.contains('\n') &&
|
||||
body_str.len() <= arm_shape.width) ||
|
||||
!context.config.wrap_match_arms ||
|
||||
is_block => {
|
||||
let block_sep = match context.config.control_brace_style {
|
||||
ControlBraceStyle::AlwaysNextLine if is_block => alt_block_sep.as_str(),
|
||||
|
@ -373,3 +373,10 @@ fn issue1456() {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
fn issue1460() {
|
||||
let _ = match foo {
|
||||
REORDER_BUFFER_CHANGE_INTERNAL_SPEC_INSERT => "internal_spec_insert_internal_spec_insert_internal_spec_insert",
|
||||
_ => "reorder_something",
|
||||
};
|
||||
}
|
||||
|
@ -389,3 +389,12 @@ fn issue1456() {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
fn issue1460() {
|
||||
let _ = match foo {
|
||||
REORDER_BUFFER_CHANGE_INTERNAL_SPEC_INSERT => {
|
||||
"internal_spec_insert_internal_spec_insert_internal_spec_insert"
|
||||
}
|
||||
_ => "reorder_something",
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user