mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
only wrap on trailing comments, allow /* */ comments in-line
This commit is contained in:
parent
b2d57b927e
commit
bd0facd4ce
@ -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 {
|
||||
|
@ -3,3 +3,9 @@ enum Issue2446 {
|
||||
f: u8, // x
|
||||
},
|
||||
}
|
||||
|
||||
enum Issue2446TrailingCommentsOnly {
|
||||
V {
|
||||
f: u8, /* */
|
||||
}
|
||||
}
|
||||
|
@ -3,3 +3,7 @@ enum Issue2446 {
|
||||
f: u8, // x
|
||||
},
|
||||
}
|
||||
|
||||
enum Issue2446TrailingCommentsOnly {
|
||||
V { f: u8 /* */ },
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user