From 55d743f01ca0e217ba6591cd4cdd32c61b5b1747 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Sat, 23 Sep 2023 12:13:42 -0400 Subject: [PATCH] fix: usings and lint stuff found by using in app --- macros/src/lib.rs | 6 ++++-- wasm-web-component/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 278de5a..ad48209 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -65,7 +65,7 @@ fn get_class_and_element_names( let element_name = match element_name.map(|n| n.token()) { Some(n) => n, None => { - let class_kebab = class_name.to_string().to_kebab_case(); + let class_kebab = class_name.to_string().to_kebab_case().to_lowercase(); LitStr::new(&class_kebab, Span::call_site()).token() } }; @@ -117,7 +117,7 @@ fn expand_struct_trait_shim(struct_name: &Ident, once_name: &Ident, observed_att } #[doc = "Defines this web component element if not defined already otherwise returns an error."] - pub fn define() -> std::result::Result<#handle_path, JsValue> { + pub fn define() -> std::result::Result<#handle_path, wasm_bindgen::JsValue> { use wasm_bindgen::JsCast; use web_sys::{window, Element, HtmlElement}; let registry = web_sys::window().unwrap().custom_elements(); @@ -253,6 +253,8 @@ fn expand_struct( let binding_trait = expand_binding(&struct_name); let expanded = quote! { use std::sync::Once; + use wasm_bindgen; + #[allow(non_snake_case)] static #struct_once_name: Once = Once::new(); #[wasm_bindgen::prelude::wasm_bindgen] #[derive(Default, Debug)] diff --git a/wasm-web-component/Cargo.toml b/wasm-web-component/Cargo.toml index 8d685f4..343ce77 100644 --- a/wasm-web-component/Cargo.toml +++ b/wasm-web-component/Cargo.toml @@ -16,7 +16,7 @@ wasm-web-component-macros = { path = "../macros" } version = "0.3" [dependencies.wasm-bindgen] -version = "= 0.2.81" +version = "~0.2" [dependencies.js-sys] version = "0.3"