]> git.lizzy.rs Git - rust.git/commitdiff
Keep brace on same line as `match` when using `ClosingNextLine` for `control_brace_st...
authorSean Olson <olson.sean.k@gmail.com>
Mon, 19 Jun 2017 14:14:51 +0000 (07:14 -0700)
committerSean Olson <olson.sean.k@gmail.com>
Mon, 19 Jun 2017 14:14:51 +0000 (07:14 -0700)
src/expr.rs

index 6546afd2d6394b1b21b2072b0140eafcb62f1af1..3c6e1ad52b960bd3231747c993220782b60383e2 100644 (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);