This commit is contained in:
Bernardo Uriarte 2022-09-04 19:01:43 +02:00
parent 378090acc8
commit 3f74f36418
2 changed files with 5 additions and 3 deletions

View file

@ -319,7 +319,7 @@ impl<A: AllowedOptions> SalsaStruct<A> {
let field_getter = field.get_name(); let field_getter = field.get_name();
let field_ty = field.ty(); let field_ty = field.ty();
if self.is_identity_field(field){ if self.is_identity_field(field) {
parse_quote_spanned! {field.field.span() => parse_quote_spanned! {field.field.span() =>
debug_struct = debug_struct.field( debug_struct = debug_struct.field(
#field_name_string, #field_name_string,
@ -331,7 +331,7 @@ impl<A: AllowedOptions> SalsaStruct<A> {
) )
); );
} }
}else{ } else {
parse_quote_spanned! {field.field.span() => parse_quote_spanned! {field.field.span() =>
if _include_all_fields { if _include_all_fields {
debug_struct = debug_struct.field( debug_struct = debug_struct.field(

View file

@ -51,6 +51,8 @@ fn input() {
// all fields // all fields
let actual = format!("{:?}", complex_struct.debug_all(&db)); let actual = format!("{:?}", complex_struct.debug_all(&db));
let expected = expect![[r#"ComplexStruct { [salsa id]: 0, my_input: MyInput { [salsa id]: 0, field: 22 }, not_salsa: NotSalsa { field: "it's salsa time" } }"#]]; let expected = expect![[
r#"ComplexStruct { [salsa id]: 0, my_input: MyInput { [salsa id]: 0, field: 22 }, not_salsa: NotSalsa { field: "it's salsa time" } }"#
]];
expected.assert_eq(&actual); expected.assert_eq(&actual);
} }