Closed ryo-ebata closed 4 months ago
vnode fastest │ slowest │ median │ mean │ samples │ iters
╰─ vnode_clone 2.857 ns │ 2.967 ns │ 2.877 ns │ 2.881 ns │ 100 │ 1000000000
vnode fastest │ slowest │ median │ mean │ samples │ iters
╰─ vnode_clone 2.774 ns │ 2.856 ns │ 2.796 ns │ 2.799 ns │ 100 │ 1000000000
Visit the preview URL for this PR (updated for commit 5abbf8a):
https://yew-rs-api--pr3677-fix-trait-bound-erro-jcsx603v.web.app
(expires Sun, 14 Jul 2024 08:41:18 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
✅ None of the examples has changed their size significantly.
Incidentally, CI is making errors in areas unrelated to my changes, but I have not done anything special about this since it is not causally related to this issue.
This error is a result of implicit-clone, a daughter crate of Yew, trying to support both indexmap
v1 & v2
See #3659 for more discussions on this, and implicit-clone/#51 that will prevent this from happening in future Yew versions
@its-the-shrimp thanks, I understood and close this.
Description
Fix conversion from IndexMap to IMap in IntoPropValue implementation
This PR addresses an error in the IntoPropValue implementation for IndexMap to IMap conversion. The original code used
IMap::from(self)
, which failed because there's no directFrom
implementation forIMap
fromindexmap::IndexMap
.Changes made:
IMap::from(self)
withIMap::from_iter(self)
Rationale:
from_iter
utilizes theFromIterator
trait to construct anIMap
from an iterator.IndexMap
implementsIntoIterator
, allowing it to be used withfrom_iter
.From
implementation betweenIMap
andIndexMap
.The change resolves the compilation error and provides a more flexible conversion method using existing trait implementations.
This change may not directly resolve the Issue, but at least it resolved a similar error that was occurring in my environment
I added yew to the dependencies package,
I added yew to the dependencies package, and ran into the error in this Issue when I did a simple HTML build to see how it worked.
Here is the code of main.rs at that time.
addresses #3659
Checklist