Give VariantData::Struct named fields, to clairfy recovered.

This commit is contained in:
Alona Enraght-Moony 2023-12-19 22:47:30 +00:00
parent d165a38de0
commit 062845421b
4 changed files with 7 additions and 5 deletions

View file

@ -546,7 +546,9 @@ pub fn eq_variant_data(l: &VariantData, r: &VariantData) -> bool {
use VariantData::*;
match (l, r) {
(Unit(_), Unit(_)) => true,
(Struct(l, _), Struct(r, _)) | (Tuple(l, _), Tuple(r, _)) => over(l, r, eq_struct_field),
(Struct { fields: l, .. }, Struct { fields: r, .. }) | (Tuple(l, _), Tuple(r, _)) => {
over(l, r, eq_struct_field)
},
_ => false,
}
}