fix clippy
This commit is contained in:
1 parent
1d664c616e
commit
33f0f0c172
8 files changed
+7
-9
No files matched your search
@@ -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() {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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 = []
|
||||
@@ -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),
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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",
|
||||
] }
|
||||
|
||||
Reference in new issue
Block a user