workers-rs icon indicating copy to clipboard operation
workers-rs copied to clipboard

[BUG] JsValue::into_serde() is deprecated in wasm_bindgen 0.2.83

Open cjpatton opened this issue 3 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What version of workers-rs are you using?

0.0.11

Describe the bug

The worker crate currently uses wasm_bindgen 0.2.80. My code makes use of JsValue::into_serde(), which is deprecated in 0.2.83. This results in compiler warnings after upgrading:

chris:~/github.com/cloudflare/daphne$ cargo build
   Compiling daphne_worker v0.2.0 (/Users/chris/github.com/cloudflare/daphne/daphne_worker)
warning: use of deprecated associated function `worker::wasm_bindgen::JsValue::into_serde`: causes dependency cycles, use `serde-wasm-bindgen` or `gloo_utils::format::JsValueSerdeExt` instead
  --> daphne_worker/src/durable/reports_pending.rs:89:76
   |
89 |                     let (key, report_hex): (String, String) = item.value().into_serde()?;
   |                                                                            ^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: `daphne_worker` (lib) generated 1 warning

Cargo suggests a couple of ways of resolving this. I believe the first suggestion of using serde-wasm-bindgen would require a change here. Would that be desirable? Based on the documentation it seems like this is where the winds are blowing.

Steps To Reproduce

No response

cjpatton avatar Oct 25 '22 00:10 cjpatton