-
Notifications
You must be signed in to change notification settings - Fork 2.6k
map/try_map for BoundedBTreeMap #11866
Comments
Sounds reasonable. Would you like to work on this? |
Absolutely! I will open a PR shortly 👍 |
#11869 implemented similar behaviour to this (adding an |
Yea… I guess that is a valid concern. Do you want to implement |
Yeah I can definitely do that! (#11869 actually started out as that 😅) I'll open a new PR for it 👍 |
FYI there is |
It would be useful if there was a way to iterate over an
&mut BoundedBTreeMap
and mutate each key in place. This wouldn't affect the length of the map at all, so it would be safe. Perhaps atry_map
or something similar would be good as well, to allow for short circuiting.I would be happy to take this on if it's deemed useful.
(BoundedBTreeMap link for the lazy:
substrate/primitives/runtime/src/bounded/bounded_btree_map.rs
Line 33 in 9a140a6
EDIT:
After some experimentation, I think this is a better API:
The text was updated successfully, but these errors were encountered: