Skip to content

Define empty for Filler? #84

@yanganto

Description

@yanganto

The #[filler(empty_value=value)] is implemented. However, we do not need so much macros. The filler rely on is_empty function. The user can implement the is_empty for his customized struct. We will consider add #[filler(empty=fn)]

#[derive(struct_patch::Filler, Debug, PartialEq, Default)]
struct Color {
    R: u8,
    G: u8,
    B: u8,
    #[filler(empty_value=0)]
    // or #[filler(default_is_empty)]
    alpha: u8,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions