]> git.lizzy.rs Git - rust.git/commitdiff
Add a space before comment that comes after a block-like chain item
authorSeiichi Uchida <seuchida@gmail.com>
Sun, 5 Aug 2018 05:37:13 +0000 (14:37 +0900)
committerSeiichi Uchida <seuchida@gmail.com>
Sun, 5 Aug 2018 05:37:13 +0000 (14:37 +0900)
src/chains.rs

index 25c3a8bbdd7cb7e6b3825a48fa6f1b1c10dda11c..3a2462e8aec7beeb0110c82ea8fddca78a669407 100644 (file)
@@ -546,6 +546,9 @@ fn join_rewrites(
         for (rewrite, prev_is_block_like) in rewrite_iter.zip(block_like_iter) {
             if !prev_is_block_like {
                 result.push_str(&connector);
+            } else if rewrite.starts_with('/') {
+                // This is comment, add a space before it.
+                result.push(' ');
             }
             result.push_str(&rewrite);
         }