-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a remove
method to the Map
reflection trait
#6563
Labels
Comments
soqb
added
C-Feature
A new feature, making something new possible
S-Needs-Triage
This issue needs to be labelled
labels
Nov 12, 2022
MrGVSV
added
A-Reflection
Runtime information about types
and removed
S-Needs-Triage
This issue needs to be labelled
labels
Nov 12, 2022
Repository owner
moved this from In Progress
to Done
in Reflection
Nov 14, 2022
taiyoungjang
pushed a commit
to taiyoungjang/bevy
that referenced
this issue
Dec 15, 2022
# Objective - Implements removal of entries from a `dyn Map` - Fixes bevyengine#6563 ## Solution - Adds a `remove` method to the `Map` trait which takes in a `&dyn Reflect` key and returns the value removed if it was present. --- ## Changelog - Added `Map::remove` ## Migration Guide - Implementors of `Map` will need to implement the `remove` method. Co-authored-by: radiish <thesethskigamer@gmail.com>
alradish
pushed a commit
to alradish/bevy
that referenced
this issue
Jan 22, 2023
# Objective - Implements removal of entries from a `dyn Map` - Fixes bevyengine#6563 ## Solution - Adds a `remove` method to the `Map` trait which takes in a `&dyn Reflect` key and returns the value removed if it was present. --- ## Changelog - Added `Map::remove` ## Migration Guide - Implementors of `Map` will need to implement the `remove` method. Co-authored-by: radiish <thesethskigamer@gmail.com>
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
# Objective - Implements removal of entries from a `dyn Map` - Fixes bevyengine#6563 ## Solution - Adds a `remove` method to the `Map` trait which takes in a `&dyn Reflect` key and returns the value removed if it was present. --- ## Changelog - Added `Map::remove` ## Migration Guide - Implementors of `Map` will need to implement the `remove` method. Co-authored-by: radiish <thesethskigamer@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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 theMap
trait which takes in an&dyn Reflect
key and returns anOption<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
).The text was updated successfully, but these errors were encountered: