fix clippy
This commit is contained in:
1 parent
9bb464dd7d
commit
e11f3fdc48
5 files changed
+5
-8
No files matched your search
@@ -47,7 +47,7 @@ pub static CURRENT_CONFIG: once_cell::sync::Lazy<
|
|||||||
Result<crate::config::CrateConfig, DioxusCLINotUsed>,
|
Result<crate::config::CrateConfig, DioxusCLINotUsed>,
|
||||||
> = once_cell::sync::Lazy::new(|| {
|
> = once_cell::sync::Lazy::new(|| {
|
||||||
CURRENT_CONFIG_JSON
|
CURRENT_CONFIG_JSON
|
||||||
.and_then(|config| serde_json::from_str(&config).ok())
|
.and_then(|config| serde_json::from_str(config).ok())
|
||||||
.ok_or_else(|| {
|
.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.");
|
tracing::error!("A library is trying to access the crate's configuration, but the dioxus CLI was not used to build the application.");
|
||||||
DioxusCLINotUsed
|
DioxusCLINotUsed
|
||||||
|
|||||||
@@ -313,10 +313,7 @@ async fn setup_router(
|
|||||||
router = if let Some(base_path) = config.dioxus_config.web.app.base_path.clone() {
|
router = if let Some(base_path) = config.dioxus_config.web.app.base_path.clone() {
|
||||||
let base_path = format!("/{}", base_path.trim_matches('/'));
|
let base_path = format!("/{}", base_path.trim_matches('/'));
|
||||||
Router::new()
|
Router::new()
|
||||||
.nest(
|
.nest(&base_path, axum::routing::any_service(router))
|
||||||
&base_path,
|
|
||||||
axum::routing::any_service(router),
|
|
||||||
)
|
|
||||||
.fallback(get(move || {
|
.fallback(get(move || {
|
||||||
let base_path = base_path.clone();
|
let base_path = base_path.clone();
|
||||||
async move { format!("Outside of the base path: {}", base_path) }
|
async move { format!("Outside of the base path: {}", base_path) }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use crate::{Result,};
|
use crate::Result;
|
||||||
use dioxus_cli_config::WebProxyConfig;
|
use dioxus_cli_config::WebProxyConfig;
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
|
|||||||
@@ -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
|
// 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.
|
// create the new children afresh.
|
||||||
if shared_keys.is_empty() {
|
if shared_keys.is_empty() {
|
||||||
if old.get(0).is_some() {
|
if !old.is_empty() {
|
||||||
self.remove_nodes(&old[1..]);
|
self.remove_nodes(&old[1..]);
|
||||||
self.replace(&old[0], new);
|
self.replace(&old[0], new);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ impl<'a> ToTokens for TemplateRenderer<'a> {
|
|||||||
fn to_tokens(&self, out_tokens: &mut TokenStream2) {
|
fn to_tokens(&self, out_tokens: &mut TokenStream2) {
|
||||||
let mut context = DynamicContext::default();
|
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::Element(el)) if self.roots.len() == 1 => el.key.clone(),
|
||||||
Some(BodyNode::Component(comp)) if self.roots.len() == 1 => comp.key().cloned(),
|
Some(BodyNode::Component(comp)) if self.roots.len() == 1 => comp.key().cloned(),
|
||||||
_ => None,
|
_ => None,
|
||||||
|
|||||||
Reference in new issue
Block a user