Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

web: rustfmt window.vectorcraft

focuerdc7216f0e4cc
diff --git a/apps/vectorcraft-web/src/api.rs b/apps/vectorcraft-web/src/api.rs
index 47252756d..526e56be1 100644
--- a/apps/vectorcraft-web/src/api.rs
+++ b/apps/vectorcraft-web/src/api.rs
@@ -19,8 +19,8 @@
use std::cell::{Cell, RefCell};
use std::sync::mpsc::{Receiver, Sender, TryRecvError};
-use vectorcraft_ui_egui::ControlRequest;
use serde_json::{Value, json};
+use vectorcraft_ui_egui::ControlRequest;
use wasm_bindgen::prelude::*;
use crate::saved_files::SavedFiles;
@@ -123,7 +123,8 @@ pub fn install() -> Result<(), JsValue> {
set_fn(
&obj,
"request",
- Closure::<dyn Fn(String, JsValue) -> js_sys::Promise>::new(|method: String, params: JsValue| request(&method, from_js(&params))).into_js_value(),
+ Closure::<dyn Fn(String, JsValue) -> js_sys::Promise>::new(|method: String, params: JsValue| request(&method, from_js(&params)))
+ .into_js_value(),
)?;
set_fn(
&obj,
diff --git a/apps/vectorcraft-web/src/main.rs b/apps/vectorcraft-web/src/main.rs
index e2e31da97..f76e54786 100644
--- a/apps/vectorcraft-web/src/main.rs
+++ b/apps/vectorcraft-web/src/main.rs
@@ -16,14 +16,14 @@
//! URL query flags: `?webgl` forces the WebGL2 backend instead of WebGPU; `?lang=es` (any
//! language code) stands in for the browser's languages when the interface language is Automatic.
+#[cfg(target_arch = "wasm32")]
+mod api;
#[cfg(target_arch = "wasm32")]
mod fonts;
#[cfg(target_arch = "wasm32")]
mod locks;
#[cfg(any(target_arch = "wasm32", test))]
mod pencil;
-#[cfg(target_arch = "wasm32")]
-mod api;
#[cfg(any(target_arch = "wasm32", test))]
mod saved_files;
#[cfg(target_arch = "wasm32")]