mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-17 06:08:26 +00:00
fix clippy
This commit is contained in:
parent
9bb464dd7d
commit
e11f3fdc48
5 changed files with 6 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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) }
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue