From 1ded995ee79c44069b7832e5aba00162fc2113fa Mon Sep 17 00:00:00 2001 From: rChaser53 Date: Thu, 5 Sep 2019 19:38:00 +0900 Subject: [PATCH] fix 'left behind trailing whitespace' (#3761) --- src/visitor.rs | 2 +- tests/target/issue-3741.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 tests/target/issue-3741.rs diff --git a/src/visitor.rs b/src/visitor.rs index 074ee37d104..dec39489a5e 100644 --- a/src/visitor.rs +++ b/src/visitor.rs @@ -623,7 +623,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> { self.push_str(s); } else { let snippet = self.snippet(span); - self.push_str(snippet); + self.push_str(snippet.trim()); } self.last_pos = source!(self, span).hi(); } diff --git a/tests/target/issue-3741.rs b/tests/target/issue-3741.rs new file mode 100644 index 00000000000..34d22dc91eb --- /dev/null +++ b/tests/target/issue-3741.rs @@ -0,0 +1,5 @@ +pub enum PublishedFileVisibility { + Public = sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityPublic as i32, + FriendsOnly = sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityFriendsOnly as i32, + Private = sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityPrivate as i32, +}