Fix indentation

In beginner chapter 9 'Model Loading', the `fn format_url(...)` line was
unnecessarily indented.  This PR also makes some minor reformatting
(presumably caused by changes to `rustfmt`).
This commit is contained in:
Kneasle 2022-04-14 16:30:19 +01:00
parent e514011384
commit 964ad9307b
5 changed files with 9 additions and 7 deletions

View File

@ -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()
}

View File

@ -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!(

View File

@ -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()
}

View File

@ -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!(

View File

@ -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!(