diff --git a/Cargo.lock b/Cargo.lock
index 52cec81..b212afc 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -244,6 +244,7 @@ dependencies = [
"js-sys",
"wasm-bindgen",
"web-sys",
+ "wee_alloc",
"yew",
]
@@ -299,6 +300,12 @@ dependencies = [
"cfg-if 0.1.10",
]
+[[package]]
+name = "memory_units"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3"
+
[[package]]
name = "miniz_oxide"
version = "0.4.3"
@@ -569,6 +576,18 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "wee_alloc"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e"
+dependencies = [
+ "cfg-if 0.1.10",
+ "libc",
+ "memory_units",
+ "winapi",
+]
+
[[package]]
name = "winapi"
version = "0.3.9"
diff --git a/Cargo.toml b/Cargo.toml
index d294109..5d33142 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,6 +15,7 @@ gpx = "0.8.1"
# yew = "0.19"
yew = { git = "https://github.com/yewstack/yew.git" }
gloo-file = "0.2"
+wee_alloc = "0.4"
console_error_panic_hook = { version = "0.1.6", optional = true }
diff --git a/src/loader.rs b/src/loader.rs
index b7adc08..4d16a9f 100644
--- a/src/loader.rs
+++ b/src/loader.rs
@@ -2,7 +2,7 @@ use std::collections::HashMap;
use gloo_file::callbacks::FileReader;
use gloo_file::File;
-use web_sys::{Event, HtmlInputElement, MouseEvent, Url};
+use web_sys::{Event, HtmlInputElement, Url, MouseEvent};
use yew::{html, html::TargetCast, Component, Context, Html};
use super::utils;
@@ -83,7 +83,7 @@ impl Component for Loader {
Err(err) => {
utils::alert(&err.to_string());
ctx.link().send_message(Msg::Reset);
- return true;
+ return true
}
};
@@ -94,9 +94,7 @@ impl Component for Loader {
let url = Url::create_object_url_with_blob(&merged).unwrap();
anchor_element.set_attribute("href", &url).unwrap();
- anchor_element
- .set_attribute("download", "merged.gpx")
- .unwrap();
+ anchor_element.set_attribute("download", "merged.gpx").unwrap();
self.is_loading = false;
@@ -122,7 +120,7 @@ impl Component for Loader {
let link = ctx.link();
html! {
if self.is_loading {
- {"loading..."}
+ {"processing..."}
} else {
();
}