only wrap on trailing comments, allow /* */ comments in-line

This commit is contained in:
Christopher Armstrong 2018-02-16 21:52:08 -06:00
parent b2d57b927e
commit bd0facd4ce
3 changed files with 11 additions and 1 deletions

View File

@ -1204,7 +1204,7 @@ pub fn format_struct_struct(
)?;
if !items_str.contains('\n') && !result.contains('\n') && items_str.len() <= one_line_budget
&& !contains_comment(&items_str)
&& !last_line_contains_single_line_comment(&items_str)
{
Some(format!("{} {} }}", result, items_str))
} else {

View File

@ -3,3 +3,9 @@ enum Issue2446 {
f: u8, // x
},
}
enum Issue2446TrailingCommentsOnly {
V {
f: u8, /* */
}
}

View File

@ -3,3 +3,7 @@ enum Issue2446 {
f: u8, // x
},
}
enum Issue2446TrailingCommentsOnly {
V { f: u8 /* */ },
}