Evan Almloff hace 1 año
padre
commit
33f0f0c172

+ 1 - 1
packages/cli/src/builder.rs

@@ -312,7 +312,7 @@ pub fn build_desktop(config: &CrateConfig, _is_serve: bool) -> Result<BuildResul
     if !config.out_dir.is_dir() {
         create_dir_all(&config.out_dir)?;
     }
-    copy(res_path, &config.out_dir.join(target_file))?;
+    copy(res_path, config.out_dir.join(target_file))?;
 
     // this code will copy all public file to the output dir
     if config.asset_dir.is_dir() {

+ 1 - 1
packages/core/src/scope_context.rs

@@ -128,7 +128,7 @@ impl ScopeContext {
                     parent.name
                 );
                 if let Some(shared) = parent.shared_contexts.borrow().iter().find_map(|any| {
-                    tracing::trace!("found context {:?}", any.type_id());
+                    tracing::trace!("found context {:?}", (**any).type_id());
                     any.downcast_ref::<T>()
                 }) {
                     return Some(shared.clone());

+ 1 - 1
packages/desktop/src/lib.rs

@@ -484,7 +484,7 @@ fn apply_edits(
             HydrateText { path, value, id } => channel.hydrate_text(path, value, id.0 as u32),
             LoadTemplate { name, index, id } => {
                 if let Some(tmpl_id) = templates.get(name) {
-                    channel.load_template(*tmpl_id as u16, index as u16, id.0 as u32)
+                    channel.load_template(*tmpl_id, index as u16, id.0 as u32)
                 }
             }
             ReplaceWith { id, m } => channel.replace_with(id.0 as u32, m as u16),

+ 1 - 2
packages/desktop/src/protocol.rs

@@ -126,7 +126,6 @@ pub(super) fn desktop_handler(
     {
         Ok(response) => {
             responder.respond(response);
-            return;
         }
         Err(err) => tracing::error!("error building response: {}", err),
     }
@@ -167,7 +166,7 @@ fn get_asset_root() -> Option<PathBuf> {
 
 /// Get the mime type from a path-like string
 fn get_mime_from_path(trimmed: &Path) -> Result<&'static str> {
-    if trimmed.ends_with(".svg") {
+    if trimmed.extension().is_some_and(|ext| ext == "svg") {
         return Ok("image/svg+xml");
     }
 

+ 1 - 1
packages/interpreter/Cargo.toml

@@ -23,5 +23,5 @@ default = []
 serialize = ["serde"]
 sledgehammer = ["sledgehammer_bindgen", "sledgehammer_utils"]
 web = ["sledgehammer", "wasm-bindgen", "js-sys", "web-sys", "sledgehammer_bindgen/web"]
-binary-protocol = ["sledgehammer"]
+binary-protocol = ["sledgehammer", "wasm-bindgen"]
 minimal_bindings = []

+ 1 - 1
packages/liveview/src/pool.rs

@@ -329,7 +329,7 @@ fn apply_edits(
             HydrateText { path, value, id } => channel.hydrate_text(path, value, id.0 as u32),
             LoadTemplate { name, index, id } => {
                 if let Some(tmpl_id) = templates.get(name) {
-                    channel.load_template(*tmpl_id as u16, index as u16, id.0 as u32)
+                    channel.load_template(*tmpl_id, index as u16, id.0 as u32)
                 }
             }
             ReplaceWith { id, m } => channel.replace_with(id.0 as u32, m as u16),

+ 1 - 1
packages/server-macro/src/lib.rs

@@ -105,7 +105,7 @@ pub fn server(args: proc_macro::TokenStream, s: TokenStream) -> TokenStream {
         let upper_cammel_case_name = Converter::new()
             .from_case(Case::Snake)
             .to_case(Case::UpperCamel)
-            .convert(&sig.ident.to_string());
+            .convert(sig.ident.to_string());
         args.struct_name = Some(Ident::new(&upper_cammel_case_name, sig.ident.span()));
     }
     let struct_name = args.struct_name.as_ref().unwrap();

+ 0 - 1
packages/web/Cargo.toml

@@ -13,7 +13,6 @@ keywords = ["dom", "ui", "gui", "react", "wasm"]
 dioxus-core = { workspace = true, features = ["serialize"] }
 dioxus-html = { workspace = true, features = ["wasm-bind"] }
 dioxus-interpreter-js = { workspace = true, features = [
-    "sledgehammer",
     "minimal_bindings",
     "web",
 ] }