Put match arm guard on the next line if it contains new line
@@ -1650,9 +1650,11 @@ fn rewrite_guard(
s.rewrite(context, cond_shape)
})
{
+ if !cond_str.contains('\n') {
return Some(format!(" if {}", cond_str));
}
}
+ }
// Not enough space to put the guard after the pattern, try a newline.
// 3 == `if `
