Clippy fixes. (#2415)

* Clippy fixes.

* Bump the web_sys required version.
This commit is contained in:
Laurent Mazare
2024-08-14 09:13:53 +01:00
committed by GitHub
parent 68aa9c7320
commit 53ce65f706
6 changed files with 18 additions and 23 deletions

View File

@ -35,7 +35,7 @@ yew-agent = "0.2.0"
yew = { version = "0.20.0", features = ["csr"] }
[dependencies.web-sys]
version = "0.3.64"
version = "0.3.70"
features = [
'Blob',
'Document',

View File

@ -9,13 +9,11 @@ use yew_agent::{Bridge, Bridged};
async fn fetch_url(url: &str) -> Result<Vec<u8>, JsValue> {
use web_sys::{Request, RequestCache, RequestInit, RequestMode, Response};
let window = web_sys::window().ok_or("window")?;
let mut opts = RequestInit::new();
let opts = opts
.method("GET")
.mode(RequestMode::Cors)
.cache(RequestCache::NoCache);
let request = Request::new_with_str_and_init(url, opts)?;
let opts = RequestInit::new();
opts.set_method("GET");
opts.set_mode(RequestMode::Cors);
opts.set_cache(RequestCache::NoCache);
let request = Request::new_with_str_and_init(url, &opts)?;
let resp_value = JsFuture::from(window.fetch_with_request(&request)).await?;