Make cargo check --all --examples work!

This commit is contained in:
Jonathan Kelley committed 2024-01-19 14:19:49 -08:00
1 parent 08475af221
commit 83bce6ce97
40 files changed
+295 -399

No files matched your search

+1 -1
View File
@@ -227,5 +227,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// wait 1 second
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
}
}
})
}
+1 -1
View File
@@ -171,5 +171,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// wait 1 second
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
}
}
})
}
+1 -1
View File
@@ -218,5 +218,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// wait 1 second
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
}
}
})
}
+13 -17
View File
@@ -167,31 +167,27 @@ impl State for Border {
fn main() -> Result<(), Box<dyn std::error::Error>> {
fn app() -> Element {
let count = use_signal(|| 0);
let mut count = use_signal(|| 0);
use_future((count,), |(count,)| async move {
use_future(|| async move {
loop {
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
count.set(*count + 1);
count += 1;
}
});
rsx! {
div{
color: "red",
div { color: "red",
"{count}",
Comp {}
}
})
}
}
fn Comp() -> Element {
rsx! {
div{
border: "",
"hello world"
}
})
div { border: "", "hello world" }
}
}
// create the vdom, the real_dom, and the binding layer between them
@@ -203,9 +199,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
]);
let mut dioxus_intigration_state = DioxusState::create(&mut rdom);
let mutations = vdom.rebuild();
// update the structure of the real_dom tree
dioxus_intigration_state.apply_mutations(&mut rdom, mutations);
let mut writer = dioxus_intigration_state.create_mutation_writer(&mut rdom);
vdom.rebuild(&mut writer);
let mut ctx = SendAnyMap::new();
// set the font size to 3.3
ctx.insert(FontSize(3.3));
@@ -222,10 +219,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
vdom.wait_for_work().await;
// get the mutations from the vdom
let mutations = vdom.render_immediate();
// update the structure of the real_dom tree
dioxus_intigration_state.apply_mutations(&mut rdom, mutations);
let mut writer = dioxus_intigration_state.create_mutation_writer(&mut rdom);
vdom.rebuild(&mut writer);
// update the state of the real_dom tree
let mut ctx = SendAnyMap::new();
@@ -245,5 +241,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("{indent}{id:?} {color:?} {size:?} {border:?} {node_type:?}");
});
}
}
})
}