Evan Almloff 1 éve
szülő
commit
e11f3fdc48

+ 1 - 1
packages/cli-config/src/lib.rs

@@ -47,7 +47,7 @@ pub static CURRENT_CONFIG: once_cell::sync::Lazy<
     Result<crate::config::CrateConfig, DioxusCLINotUsed>,
 > = once_cell::sync::Lazy::new(|| {
     CURRENT_CONFIG_JSON
-        .and_then(|config| serde_json::from_str(&config).ok())
+        .and_then(|config| serde_json::from_str(config).ok())
         .ok_or_else(|| {
             tracing::error!("A library is trying to access the crate's configuration, but the dioxus CLI was not used to build the application.");
             DioxusCLINotUsed

+ 1 - 4
packages/cli/src/server/web/mod.rs

@@ -313,10 +313,7 @@ async fn setup_router(
     router = if let Some(base_path) = config.dioxus_config.web.app.base_path.clone() {
         let base_path = format!("/{}", base_path.trim_matches('/'));
         Router::new()
-            .nest(
-                &base_path,
-                axum::routing::any_service(router),
-            )
+            .nest(&base_path, axum::routing::any_service(router))
             .fallback(get(move || {
                 let base_path = base_path.clone();
                 async move { format!("Outside of the base path: {}", base_path) }

+ 2 - 2
packages/cli/src/server/web/proxy.rs

@@ -1,6 +1,6 @@
-use crate::{Result,};
+use crate::Result;
 use dioxus_cli_config::WebProxyConfig;
-   
+
 use anyhow::Context;
 use axum::{http::StatusCode, routing::any, Router};
 use hyper::{Request, Response, Uri};

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

@@ -560,7 +560,7 @@ impl<'b> VirtualDom {
         // If none of the old keys are reused by the new children, then we remove all the remaining old children and
         // create the new children afresh.
         if shared_keys.is_empty() {
-            if old.get(0).is_some() {
+            if !old.is_empty() {
                 self.remove_nodes(&old[1..]);
                 self.replace(&old[0], new);
             } else {

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

@@ -193,7 +193,7 @@ impl<'a> ToTokens for TemplateRenderer<'a> {
     fn to_tokens(&self, out_tokens: &mut TokenStream2) {
         let mut context = DynamicContext::default();
 
-        let key = match self.roots.get(0) {
+        let key = match self.roots.first() {
             Some(BodyNode::Element(el)) if self.roots.len() == 1 => el.key.clone(),
             Some(BodyNode::Component(comp)) if self.roots.len() == 1 => comp.key().cloned(),
             _ => None,