Fix issue with extra semicolon when import comment preceeds semicolon

This commit is contained in:
David Bar-On 2021-03-17 11:55:51 +02:00 committed by Yacin Tmimi
parent 1340fc412a
commit c7c57f8a16

View File

@ -637,7 +637,7 @@ pub(crate) fn extract_post_comment(
post_snippet.trim_matches(white_space)
}
// not comment or over two lines
else if post_snippet.ends_with(',')
else if post_snippet.ends_with(separator)
&& (!post_snippet.trim().starts_with("//") || post_snippet.trim().contains('\n'))
{
post_snippet[..(post_snippet.len() - 1)].trim_matches(white_space)