Keep brace on same line as match when using ClosingNextLine for control_brace_style.

This commit is contained in:
Sean Olson
2017-06-19 07:14:51 -07:00
parent a87a4450aa
commit d7298fbd97
+2 -2
View File
@@ -1461,8 +1461,8 @@ fn rewrite_match(
let cond_str = try_opt!(cond.rewrite(context, cond_shape));
let alt_block_sep = String::from("\n") + &shape.indent.block_only().to_string(context.config);
let block_sep = match context.config.control_brace_style() {
ControlBraceStyle::AlwaysSameLine => " ",
_ => alt_block_sep.as_str(),
ControlBraceStyle::AlwaysNextLine => alt_block_sep.as_str(),
_ => " ",
};
let mut result = format!("match {}{}{{", cond_str, block_sep);