-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
TryFromJs
from JsMap
for HashMap
& BtreeMap
#3998
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I have a small suggestion to simplify things.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3998 +/- ##
==========================================
+ Coverage 47.24% 52.91% +5.66%
==========================================
Files 476 483 +7
Lines 46892 46893 +1
==========================================
+ Hits 22154 24813 +2659
+ Misses 24738 22080 -2658 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! Just had a small thought on the function name that I thought might be worth a little bikeshedding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks for your work on this! 😄
Seems like
TryFromJs
didn't convert correctly fromJsMap
intoHashMap
/BtreeMap
This PR fix it
Example
Next code
before this changes will return:
and after changes returns:
Notes
I don't find more fast way(than the one used in
for_each_elem_in_js_map
) to get(key, value)
's fromJsMap
.Maybe there is a way?
Or maybe I should write it (for example by function like next but that just return
Option<(JsValue, JsValue)>
)?