From b7151f8450739b3e608932a513f9e287fa3764f4 Mon Sep 17 00:00:00 2001 From: John-John Tedro Date: Tue, 13 Aug 2024 18:36:28 +0200 Subject: [PATCH] wasm: stop using deprecated --- crates/rune-wasm/src/http.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/rune-wasm/src/http.rs b/crates/rune-wasm/src/http.rs index d7ca7b645..6bdcb3418 100644 --- a/crates/rune-wasm/src/http.rs +++ b/crates/rune-wasm/src/http.rs @@ -25,9 +25,9 @@ struct Error; /// Perform a `get` request. async fn get(url: Ref) -> Result { - let mut opts = web_sys::RequestInit::new(); - opts.method("GET"); - opts.mode(web_sys::RequestMode::Cors); + let opts = web_sys::RequestInit::new(); + opts.set_method("GET"); + opts.set_mode(web_sys::RequestMode::Cors); let request = web_sys::Request::new_with_str(&url); let window = web_sys::window().ok_or(Error)?; let request = request.map_err(|_| Error)?;