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)); + } } }