From 496e95846745aaa3f90c07cfd24bea1b6b24a0fa Mon Sep 17 00:00:00 2001 From: topecongiro Date: Wed, 14 Jun 2017 20:36:28 +0900 Subject: [PATCH] Put match arm guard on the next line if it contains new line --- src/expr.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/expr.rs b/src/expr.rs index 1e92b5b9368e..e45aa20a68ab 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1650,7 +1650,9 @@ fn rewrite_guard( s.rewrite(context, cond_shape) }) { - return Some(format!(" if {}", cond_str)); + if !cond_str.contains('\n') { + return Some(format!(" if {}", cond_str)); + } } }