unstable clipboard logic on web is incompatible with web_sys 0.3.70
I'm trying to use web_sys_unstable_apis in my project, but it started failing due to an error coming from some special clipboard logic in eframe.
The error:
--> /Users/syte-laptop/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eframe-0.28.1/src/web/mod.rs:187:16
|
187 | if let Some(clipboard) = window.navigator().clipboard() {
| ^^^^^^^^^^^^^^^ ------------------------------ this expression has type `Clipboard`
| |
| expected `Clipboard`, found `Option<_>`
|
= note: expected struct `Clipboard`
found enum `Option<_>`
The source: https://github.com/emilk/egui/blob/master/crates/eframe/src/web/mod.rs#L171-L192
In v0.3.69 and before of web_sys, the return of .clipboard() is Option<Clipboard>. In v0.3.70, it is now just Clipboard
Thankfully, I'm able to just pin my web_sys dependency to =0.3.69 and I'm able to compile again
@simon-wh Could you test if the branch from PR #4954 works for you?
@simon-wh Could you test if the branch from PR #4954 works for you?
Looks to be working 👍
Compiling that is, I'm not using this clipboard behaviour so I cannot validate the updated logic
I also met this problem. When will the #4954 be merged? 😄
@bioinformatist please have a look at #4980