Skip to content

Commit df30a7a

Browse files
committed
Give VariantData::Struct named fields, to clairfy recovered.
1 parent ca2472e commit df30a7a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/items.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ impl<'a> FmtVisitor<'a> {
666666
let span = mk_sp(lo, field.span.lo());
667667

668668
let variant_body = match field.data {
669-
ast::VariantData::Tuple(..) | ast::VariantData::Struct(..) => format_struct(
669+
ast::VariantData::Tuple(..) | ast::VariantData::Struct { .. } => format_struct(
670670
&context,
671671
&StructParts::from_variant(field, &context),
672672
self.block_indent,
@@ -1092,7 +1092,7 @@ fn enum_variant_span(variant: &ast::Variant, context: &RewriteContext<'_>) -> Sp
10921092
if let Some(ref anon_const) = variant.disr_expr {
10931093
let span_before_consts = variant.span.until(anon_const.value.span);
10941094
let hi = match &variant.data {
1095-
Struct(..) => context
1095+
Struct { .. } => context
10961096
.snippet_provider
10971097
.span_after_last(span_before_consts, "}"),
10981098
Tuple(..) => context
@@ -1112,12 +1112,12 @@ fn format_struct(
11121112
offset: Indent,
11131113
one_line_width: Option<usize>,
11141114
) -> Option<String> {
1115-
match *struct_parts.def {
1115+
match struct_parts.def {
11161116
ast::VariantData::Unit(..) => format_unit_struct(context, struct_parts, offset),
1117-
ast::VariantData::Tuple(ref fields, _) => {
1117+
ast::VariantData::Tuple(fields, _) => {
11181118
format_tuple_struct(context, struct_parts, fields, offset)
11191119
}
1120-
ast::VariantData::Struct(ref fields, _) => {
1120+
ast::VariantData::Struct { fields, .. } => {
11211121
format_struct_struct(context, struct_parts, fields, offset, one_line_width)
11221122
}
11231123
}

0 commit comments

Comments
 (0)