diff --git a/embed/build.rs b/embed/build.rs index c4e83ae..a18520f 100644 --- a/embed/build.rs +++ b/embed/build.rs @@ -143,7 +143,7 @@ fn main() -> Result<(), anyhow::Error> { println!("cargo:warning=see {}", out_dir); // this creates /wasm.js & wasm_bg.wasm - let wasm_out = out_dir.to_owned() + "/wasm"; + let wasm_out = out_dir + "/wasm"; create_dir_if_not_exist(&wasm_out)?; let status = Command::new(wasm_bindgen) .args(&[ diff --git a/embed/src/lib.rs b/embed/src/lib.rs index 107a776..8e3e033 100644 --- a/embed/src/lib.rs +++ b/embed/src/lib.rs @@ -5,10 +5,10 @@ use std::{concat, env, include_bytes}; pub fn wasm() -> Cursor<&'static [u8]> { let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/wasm/choosy_frontend_bg.wasm")); - return Cursor::new(bytes); + Cursor::new(bytes) } pub fn wasm_js() -> Cursor<&'static [u8]> { let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/wasm/choosy_frontend.js")); - return Cursor::new(bytes); + Cursor::new(bytes) } diff --git a/frontend/src/lib.rs b/frontend/src/lib.rs index a4d72c1..07a28f0 100644 --- a/frontend/src/lib.rs +++ b/frontend/src/lib.rs @@ -200,7 +200,7 @@ impl Component for Model { // // https://github.com/yewstack/yew/issues/1851 value={self.search.clone()} - oninput={ctx.link().callback(|e: InputEvent| Msg::UpdateSearch{s: e.data().unwrap_or("".to_string())})} + oninput={ctx.link().callback(|e: InputEvent| Msg::UpdateSearch{s: e.data().unwrap_or_else(|| "".to_string())})} style="width: 100%;" />