Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can we remove 'static lifetime bound from Node/El ? #394

Closed
MuhannadAlrusayni opened this issue Mar 21, 2020 · 3 comments · Fixed by #396
Closed

Can we remove 'static lifetime bound from Node/El ? #394

MuhannadAlrusayni opened this issue Mar 21, 2020 · 3 comments · Fixed by #396

Comments

@MuhannadAlrusayni
Copy link
Contributor

MuhannadAlrusayni commented Mar 21, 2020

Hi, I was wondering why there is 'static bound in Node<Ms: 'static> and El<Ms: 'static> types, after checking I was not able to find their need.

Can we remove 'static bound ?
why I need to do so? because when I want to create elements that contains Node<Ms> in it I have to write that bound every where (e.g. Buutton).

If we cannot remove the bound for any reason, then I think we can move it to the impl block, so any type contains Node<Ms> in it would not need to write the bound.

Or there is better way to solve this issue ?

@MartinKavik
Copy link
Member

See https://rustwasm.github.io/wasm-bindgen/api/wasm_bindgen/closure/struct.Closure.html and rustwasm/wasm-bindgen#1914.
^ it's probably the main reason. If you are able to remove that restriction and not negatively affect public API, I would be happy to merge it.

@MartinKavik
Copy link
Member

Also it's probably needed for the Effect queue.

@MuhannadAlrusayni
Copy link
Contributor Author

I just removed the bound .. and things seems to work fine.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants