fix formatting

This commit is contained in:
Evan Almloff committed 2023-03-14 17:26:59 -05:00
1 parent a37b29947b
commit 8b5551e5d2
2 files changed
+6 -8

No files matched your search

+5 -5
View File
@@ -302,8 +302,8 @@ pub fn partial_derive_state(_: TokenStream, input: TokenStream) -> TokenStream {
// if a create function is defined, we don't generate one // if a create function is defined, we don't generate one
// otherwise we generate a default one that uses the update function and the default constructor // otherwise we generate a default one that uses the update function and the default constructor
let create_fn = (!has_create_fn).then(||{ let create_fn = (!has_create_fn).then(|| {
quote!{ quote! {
fn create<'a>( fn create<'a>(
node_view: dioxus_native_core::prelude::NodeView<()>, node_view: dioxus_native_core::prelude::NodeView<()>,
node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>, node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>,
@@ -329,7 +329,7 @@ pub fn partial_derive_state(_: TokenStream, input: TokenStream) -> TokenStream {
use dioxus_native_core::exports::shipyard::{IntoWorkloadSystem, Get, AddComponent}; use dioxus_native_core::exports::shipyard::{IntoWorkloadSystem, Get, AddComponent};
use dioxus_native_core::tree::TreeRef; use dioxus_native_core::tree::TreeRef;
use dioxus_native_core::prelude::{NodeType, NodeView}; use dioxus_native_core::prelude::{NodeType, NodeView};
let node_mask = Self::NODE_MASK.build(); let node_mask = Self::NODE_MASK.build();
(move |data: #combined_dependencies_quote, run_view: dioxus_native_core::prelude::RunPassView #trait_generics| { (move |data: #combined_dependencies_quote, run_view: dioxus_native_core::prelude::RunPassView #trait_generics| {
@@ -351,7 +351,7 @@ pub fn partial_derive_state(_: TokenStream, input: TokenStream) -> TokenStream {
#deref_child_view #deref_child_view
let view = NodeView::new(id, node_data, &node_mask); let view = NodeView::new(id, node_data, &node_mask);
if let Some(myself) = myself { if let Some(myself) = myself {
myself myself
.update(view, node, parent, children, context) .update(view, node, parent, children, context)
} }
@@ -360,7 +360,7 @@ pub fn partial_derive_state(_: TokenStream, input: TokenStream) -> TokenStream {
id, id,
Self::create(view, node, parent, children, context)); Self::create(view, node, parent, children, context));
true true
} }
}) })
}).into_workload_system().unwrap() }).into_workload_system().unwrap()
} }
+1 -3
View File
@@ -131,9 +131,7 @@ fn native_core_is_okay() {
.unwrap(); .unwrap();
rt.block_on(async { rt.block_on(async {
let rdom = Arc::new(Mutex::new(RealDom::new([ let rdom = Arc::new(Mutex::new(RealDom::new([BlablaState::to_type_erased()])));
BlablaState::to_type_erased(),
])));
let mut dioxus_state = DioxusState::create(&mut *rdom.lock().unwrap()); let mut dioxus_state = DioxusState::create(&mut *rdom.lock().unwrap());
let mut dom = VirtualDom::new(app); let mut dom = VirtualDom::new(app);