Skip to content

Option<T> methods should take T directly #11

@tqwewe

Description

@tqwewe

I'm using makeit heavily with props for a web framework, and currently when a prop is an Option<T>, you have to write <MyComponent prop={Some(val)} />, but it would be much more desireable in my case to do <MyComponent prop={val} />.

Could the set_ methods generated for fields of type Option<T> take T directly rather than the option itself?

If needed, another method set_none could be generated for options which would set it to None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions