mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-05 13:13:40 +00:00
Refactor: use less vertical lines
This commit is contained in:
parent
033ce59a6a
commit
d9e31be40f
22
src/expr.rs
22
src/expr.rs
@ -1597,13 +1597,11 @@ fn rewrite_match_arm(
|
||||
arm_comma(context.config, body, is_last),
|
||||
));
|
||||
}
|
||||
(
|
||||
mk_sp(
|
||||
arm.attrs[arm.attrs.len() - 1].span.hi(),
|
||||
arm.pats[0].span.lo(),
|
||||
),
|
||||
arm.attrs.rewrite(context, shape)?,
|
||||
)
|
||||
let missing_span = mk_sp(
|
||||
arm.attrs[arm.attrs.len() - 1].span.hi(),
|
||||
arm.pats[0].span.lo(),
|
||||
);
|
||||
(missing_span, arm.attrs.rewrite(context, shape)?)
|
||||
} else {
|
||||
(mk_sp(arm.span().lo(), arm.span().lo()), String::new())
|
||||
};
|
||||
@ -1727,14 +1725,10 @@ fn rewrite_match_body(
|
||||
};
|
||||
|
||||
let forbid_same_line = has_guard && pats_str.contains('\n') && !is_empty_block;
|
||||
let next_line_indent = if is_block {
|
||||
if is_empty_block {
|
||||
shape.indent.block_indent(context.config)
|
||||
} else {
|
||||
shape.indent
|
||||
}
|
||||
} else {
|
||||
let next_line_indent = if !is_block || is_empty_block {
|
||||
shape.indent.block_indent(context.config)
|
||||
} else {
|
||||
shape.indent
|
||||
};
|
||||
let combine_next_line_body = |body_str: &str| {
|
||||
if is_block {
|
||||
|
Loading…
Reference in New Issue
Block a user