From f075fd01abf58d1a8b39a7326f9ed4279ad9c277 Mon Sep 17 00:00:00 2001 From: Sinh Pham Date: Thu, 8 Oct 2015 22:49:16 -0700 Subject: [PATCH] Fix https://github.com/nrc/rustfmt/issues/430 --- src/lists.rs | 2 +- tests/source/multiple.rs | 5 ++++- tests/target/multiple.rs | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lists.rs b/src/lists.rs index 35705611f1e..0f77ea6a750 100644 --- a/src/lists.rs +++ b/src/lists.rs @@ -395,7 +395,7 @@ fn next(&mut self) -> Option { separator_index + 1) } // Potential *single* line comment. - (_, Some(j)) => j + 1, + (_, Some(j)) if j > separator_index => j + 1, _ => post_snippet.len(), } } diff --git a/tests/source/multiple.rs b/tests/source/multiple.rs index a0a3f2599e8..dc1fefb9019 100644 --- a/tests/source/multiple.rs +++ b/tests/source/multiple.rs @@ -108,4 +108,7 @@ fn main() { let rc = RefCell::new(42usize,remaining_width, remaining_width); // a comment let x = "Hello!!!!!!!!! abcd abcd abcd abcd abcd abcd\n abcd abcd abcd abcd abcd abcd abcd abcd abcd \ abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \ - abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd"; } + abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd"; + let s = expand(a + , + b); } diff --git a/tests/target/multiple.rs b/tests/target/multiple.rs index 0f7ddef007c..2ec281ae04e 100644 --- a/tests/target/multiple.rs +++ b/tests/target/multiple.rs @@ -139,4 +139,5 @@ fn main() { abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \ abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \ abcd abcd"; + let s = expand(a, b); }