bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Add a `remove` method to the `Map` reflection trait

Open soqb opened this issue 3 years ago • 0 comments

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).

soqb avatar Nov 12 '22 18:11 soqb