We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 368a9b7 commit 940eaa1Copy full SHA for 940eaa1
src/items.rs
@@ -1709,7 +1709,7 @@ pub(crate) fn rewrite_struct_field(
1709
let mut spacing = String::from(if field.ident.is_some() {
1710
type_annotation_spacing.1
1711
} else {
1712
- ""
+ " "
1713
});
1714
// Try to put everything on a single line.
1715
let attr_prefix = combine_strs_with_missing_comments(
@@ -1733,7 +1733,7 @@ pub(crate) fn rewrite_struct_field(
1733
.offset_left(overhead + spacing.len())
1734
.and_then(|ty_shape| field.ty.rewrite(context, ty_shape));
1735
if let Some(ref ty) = orig_ty {
1736
- if !ty.contains('\n') {
+ if !ty.contains('\n') && contains_comment(ty) {
1737
return Some(attr_prefix + &spacing + ty);
1738
}
1739
0 commit comments