mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
cargo fmt
This commit is contained in:
parent
9666c9c0c5
commit
9fd881603f
4 changed files with 32 additions and 30 deletions
|
@ -1,2 +1 @@
|
|||
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
mod component_builder;
|
||||
mod slot_helper;
|
||||
|
||||
use self::{component_builder::component_to_tokens, slot_helper::{get_slot, slot_to_tokens}};
|
||||
use self::{
|
||||
component_builder::component_to_tokens,
|
||||
slot_helper::{get_slot, slot_to_tokens},
|
||||
};
|
||||
use convert_case::{Case::Snake, Casing};
|
||||
use leptos_hot_reload::parsing::is_component_node;
|
||||
use proc_macro2::{Ident, Span, TokenStream, TokenTree};
|
||||
|
@ -12,9 +15,7 @@ use rstml::node::{
|
|||
NodeNameFragment,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use syn::{
|
||||
spanned::Spanned, Expr, ExprRange, Lit, LitStr, RangeLimits, Stmt,
|
||||
};
|
||||
use syn::{spanned::Spanned, Expr, ExprRange, Lit, LitStr, RangeLimits, Stmt};
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
pub(crate) enum TagType {
|
||||
|
@ -95,8 +96,9 @@ fn fragment_to_tokens(
|
|||
global_class,
|
||||
view_marker,
|
||||
);
|
||||
if children.is_empty() { None }
|
||||
else if children.len() == 1 {
|
||||
if children.is_empty() {
|
||||
None
|
||||
} else if children.len() == 1 {
|
||||
children.into_iter().next()
|
||||
} else {
|
||||
Some(quote! {
|
||||
|
@ -211,7 +213,7 @@ pub(crate) fn element_to_tokens(
|
|||
if let Some(slot) = get_slot(node) {
|
||||
slot_to_tokens(node, slot, parent_slots, global_class);
|
||||
None
|
||||
} else {
|
||||
} else {
|
||||
Some(component_to_tokens(node, global_class))
|
||||
}
|
||||
} else if is_spread_marker(node) {
|
||||
|
|
|
@ -9,26 +9,21 @@ use any_spawner::Executor;
|
|||
use either_of::{Either, EitherOf3};
|
||||
use futures::FutureExt;
|
||||
use reactive_graph::{
|
||||
computed::{ScopedFuture},
|
||||
computed::ScopedFuture,
|
||||
owner::{provide_context, Owner},
|
||||
signal::{ArcRwSignal},
|
||||
signal::ArcRwSignal,
|
||||
traits::{ReadUntracked, Set},
|
||||
transition::AsyncTransition,
|
||||
wrappers::write::SignalSetter,
|
||||
};
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
iter,
|
||||
mem,
|
||||
rc::Rc,
|
||||
};
|
||||
use std::{cell::RefCell, iter, mem, rc::Rc};
|
||||
use tachys::{
|
||||
hydration::Cursor,
|
||||
renderer::Renderer,
|
||||
ssr::StreamBuilder,
|
||||
view::{
|
||||
add_attr::AddAnyAttr,
|
||||
Mountable, Position, PositionState, Render, RenderHtml,
|
||||
add_attr::AddAnyAttr, Mountable, Position, PositionState, Render,
|
||||
RenderHtml,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -38,7 +33,7 @@ pub(crate) struct FlatRoutesView<Loc, Defs, Fal, R> {
|
|||
pub routes: Routes<Defs, R>,
|
||||
pub fallback: Fal,
|
||||
pub outer_owner: Owner,
|
||||
pub set_is_routing: Option<SignalSetter<bool>>
|
||||
pub set_is_routing: Option<SignalSetter<bool>>,
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -284,7 +279,7 @@ where
|
|||
routes,
|
||||
fallback,
|
||||
outer_owner,
|
||||
set_is_routing
|
||||
set_is_routing,
|
||||
} = self;
|
||||
let url_snapshot = current_url.read_untracked();
|
||||
|
||||
|
@ -359,14 +354,17 @@ where
|
|||
async move {
|
||||
provide_context(url);
|
||||
provide_context(params);
|
||||
let view = if let Some(set_is_routing) = set_is_routing {
|
||||
set_is_routing.set(true);
|
||||
let value = AsyncTransition::run(|| view.choose()).await;
|
||||
set_is_routing.set(false);
|
||||
value
|
||||
} else {
|
||||
view.choose().await
|
||||
};
|
||||
let view =
|
||||
if let Some(set_is_routing) = set_is_routing {
|
||||
set_is_routing.set(true);
|
||||
let value =
|
||||
AsyncTransition::run(|| view.choose())
|
||||
.await;
|
||||
set_is_routing.set(false);
|
||||
value
|
||||
} else {
|
||||
view.choose().await
|
||||
};
|
||||
|
||||
// only update the route if it's still the current path
|
||||
// i.e., if we've navigated away before this has loaded, do nothing
|
||||
|
@ -467,7 +465,7 @@ where
|
|||
<Defs::Match as MatchInterface<R>>::View,
|
||||
> as RenderHtml<R>>::MIN_LENGTH;
|
||||
|
||||
fn dry_resolve(&mut self) { }
|
||||
fn dry_resolve(&mut self) {}
|
||||
|
||||
async fn resolve(self) -> Self::AsyncOutput {
|
||||
self
|
||||
|
|
|
@ -17,7 +17,10 @@ pub mod prelude {
|
|||
node_ref::NodeRefAttribute,
|
||||
},
|
||||
renderer::{dom::Dom, Renderer},
|
||||
view::{any_view::IntoAny, add_attr::AddAnyAttr, Mountable, Render, RenderHtml},
|
||||
view::{
|
||||
add_attr::AddAnyAttr, any_view::IntoAny, Mountable, Render,
|
||||
RenderHtml,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue