From d4bf413956c5e70dfe42cbca062fcb349ecdff5d Mon Sep 17 00:00:00 2001 From: topecongiro Date: Sat, 5 Aug 2017 15:23:23 +0900 Subject: [PATCH] Do not add missing snippet between arms if it's just spaces --- src/expr.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/expr.rs b/src/expr.rs index a847733e7bd..d276bcc2951 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1615,7 +1615,9 @@ fn rewrite_match_arms( arm_shape, &arm_indent_str, )); - result.push_str(&comment); + if !comment.chars().all(|c| c == ' ') { + result.push_str(&comment); + } result.push('\n'); result.push_str(&arm_indent_str);