build error: no method named `is_empty` found for struct `UnboundedSender` in the current scope
Problem
UnboundedSender::is_empty is only present in >= futures-channel-0.3.29, but is used by dioxus-core despite dioxus only depending on futures-channel-0.3.21.
If dioxus is used as a dependency in another project that resolves the futures-channel dependency to a version < 0.3.29, this causes a build failure:
error[E0599]: no method named `is_empty` found for struct `UnboundedSender` in the current scope
--> [snip]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dioxus-core-0.6.0-alpha.2/src/reactive_context.rs:65:20
|
65 | if !tx.is_empty() {
| ^^^^^^^^ method not found in `UnboundedSender<_>`
Steps To Reproduce
Steps to reproduce the behavior:
- Change the
futures-channeldependency version to0.28.0(emulating a project that has other dependencies that end up resolving thefutures-channeldependency to version0.28.0of the package) -
$ cargo build
Expected behavior
- build should succeed
Environment:
- Dioxus version:
main - Rust version:
1.81.0 - OS info:
GNU/Linux 6.6.51 (Gentoo) - App platform:
desktop
Questionnaire
- [ ] I'm interested in fixing this myself but don't know where to start
- [x] I would like to fix and I have a solution
- [ ] I don't have time to fix this right now, but maybe later
I tried bumping to the latest version of futures-channel, 0.31.0, ran all the tests described in the contribution guide, and everything builds successfully and passes. I can make a PR if you'd like.
I tried bumping to the latest version of futures-channel, 0.31.0, ran all the tests described in the contribution guide, and everything builds successfully and passes. I can make a PR if you'd like.
That would be great!