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
+1 for sure. I've done this everything-except-the-closure debug impl many times as well.
Maybe the Debug impl should expose more information? For example, it could call .toString() on the JS function.
Don't think we should do this -- the function's source won't be anything that the user authored, just wasm-bindgen's internally defined JS source for closures.
samcday
added a commit
to samcday/wasm-bindgen
that referenced
this issue
Mar 29, 2019
Motivation
When implementing rustwasm/gloo#30, I created this type:
I would really like to just slap a
#[derive(Debug)]
and call it a day, butClosure
doesn't implDebug
, so I have to do this instead:Proposed Solution
I propose that
Closure
should provide aDebug
impl, which essentially just outputsClosure { ... }
(or similar).Alternatives
Maybe the
Debug
impl should expose more information? For example, it could call.toString()
on the JS function.The text was updated successfully, but these errors were encountered: