Skip to content

Add a remove method to the Map reflection trait #6563

@soqb

Description

@soqb

What problem does this solve or what need does it fill?

There is currently no way to remove an entry from a dyn Map other than through downcasting.

What solution would you like?

Add a remove method to the Map trait which takes in an &dyn Reflect key and returns an Option<Box<dyn Reflect>> representing the value removed (if present).

What alternative(s) have you considered?

Leave as is, require downcasting to remove entries.

Additional context

As discussed with @MrGVSV on discord. Compliments the work done in #5797 (List::pop).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ReflectionRuntime information about typesC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions