You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I try to access the state from MapExtra the compiler complains about not being able to infer the state. It doesn't matter if it's in select!. map_with or anything else.
Unfortunately, this is due to a limitation in rustc (interestingly, other Rust compilers like mrustc doesn't have this limitation and can in theory infer this type without extra hints). Rust will only permit a method call if, by the time that it meets the method call, it knows the full type of the left-hand side (or can infer it from the method call alone).
You can easily provide a hint to Rust by doing (e.state() as &mut MyStateType).intern(string).
Whenever I try to access the state from
MapExtra
the compiler complains about not being able to infer the state. It doesn't matter if it's inselect!
.map_with
or anything else.Example:
And the error:
The text was updated successfully, but these errors were encountered: