structdiff icon indicating copy to clipboard operation
structdiff copied to clipboard

feat: struct level #[difference(recurse)]

Open carlocorradini opened this issue 7 months ago • 0 comments

Allow #[difference(recurse)] to be used at the struct level. The latter allows to recursively apply recurse to all struct fields without having to provide #[difference(recurse)] for each one. Furthermore, if a field should skip the struct level recurse (i.e., an unit enum), allow #[difference(recurse(skip))].

#[derive(Difference, Debug, Clone)]
#[difference(recurse)]
pub struct Entity {
    pub id: String,
    #[difference(recurse(skip))]
    pub status: MyEnum,
    pub location: MyStruct,
}

carlocorradini avatar Jul 01 '25 13:07 carlocorradini