diff --git a/code/beginner/tutorial9-models/src/resources.rs b/code/beginner/tutorial9-models/src/resources.rs index 4949756f..b54dee58 100644 --- a/code/beginner/tutorial9-models/src/resources.rs +++ b/code/beginner/tutorial9-models/src/resources.rs @@ -6,14 +6,15 @@ use wgpu::util::DeviceExt; use crate::{model, texture}; #[cfg(target_arch = "wasm32")] - fn format_url(file_name: &str) -> reqwest::Url { +fn format_url(file_name: &str) -> reqwest::Url { let window = web_sys::window().unwrap(); let location = window.location(); let base = reqwest::Url::parse(&format!( "{}/{}/", location.origin().unwrap(), option_env!("RES_PATH").unwrap_or("res"), - )).unwrap(); + )) + .unwrap(); base.join(file_name).unwrap() } diff --git a/code/intermediate/tutorial10-lighting/src/resources.rs b/code/intermediate/tutorial10-lighting/src/resources.rs index 4949756f..72c97482 100644 --- a/code/intermediate/tutorial10-lighting/src/resources.rs +++ b/code/intermediate/tutorial10-lighting/src/resources.rs @@ -6,7 +6,7 @@ use wgpu::util::DeviceExt; use crate::{model, texture}; #[cfg(target_arch = "wasm32")] - fn format_url(file_name: &str) -> reqwest::Url { +fn format_url(file_name: &str) -> reqwest::Url { let window = web_sys::window().unwrap(); let location = window.location(); let base = reqwest::Url::parse(&format!( diff --git a/code/intermediate/tutorial11-normals/src/resources.rs b/code/intermediate/tutorial11-normals/src/resources.rs index a8d60bae..e4c2abb0 100644 --- a/code/intermediate/tutorial11-normals/src/resources.rs +++ b/code/intermediate/tutorial11-normals/src/resources.rs @@ -6,14 +6,15 @@ use wgpu::util::DeviceExt; use crate::{model, texture}; #[cfg(target_arch = "wasm32")] - fn format_url(file_name: &str) -> reqwest::Url { +fn format_url(file_name: &str) -> reqwest::Url { let window = web_sys::window().unwrap(); let location = window.location(); let base = reqwest::Url::parse(&format!( "{}/{}/", location.origin().unwrap(), option_env!("RES_PATH").unwrap_or("res"), - )).unwrap(); + )) + .unwrap(); base.join(file_name).unwrap() } diff --git a/code/intermediate/tutorial12-camera/src/resources.rs b/code/intermediate/tutorial12-camera/src/resources.rs index a8d60bae..9748884f 100644 --- a/code/intermediate/tutorial12-camera/src/resources.rs +++ b/code/intermediate/tutorial12-camera/src/resources.rs @@ -6,7 +6,7 @@ use wgpu::util::DeviceExt; use crate::{model, texture}; #[cfg(target_arch = "wasm32")] - fn format_url(file_name: &str) -> reqwest::Url { +fn format_url(file_name: &str) -> reqwest::Url { let window = web_sys::window().unwrap(); let location = window.location(); let base = reqwest::Url::parse(&format!( diff --git a/docs/beginner/tutorial9-models/README.md b/docs/beginner/tutorial9-models/README.md index 8c005747..13cb5a96 100644 --- a/docs/beginner/tutorial9-models/README.md +++ b/docs/beginner/tutorial9-models/README.md @@ -142,7 +142,7 @@ use wgpu::util::DeviceExt; use crate::{model, texture}; #[cfg(target_arch = "wasm32")] - fn format_url(file_name: &str) -> reqwest::Url { +fn format_url(file_name: &str) -> reqwest::Url { let window = web_sys::window().unwrap(); let location = window.location(); let base = reqwest::Url::parse(&format!(