Assert that launch never returns for better compiler errors (#2517)

* assert that launch never returns for better compiler errors

* fix static generation launch function

* fix web renderer
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-06-18 16:04:36 -07:00
1 parent 5e3bb4f549
commit f4a62fad6b
5 files changed
+122 -67

No files matched your search

+3 -1
View File
@@ -8,7 +8,7 @@ pub fn launch(
root: fn() -> Element,
contexts: Vec<Box<dyn Fn() -> Box<dyn Any> + Send + Sync>>,
platform_config: Config,
) {
) -> ! {
#[cfg(feature = "multi-threaded")]
let mut builder = tokio::runtime::Builder::new_multi_thread();
#[cfg(not(feature = "multi-threaded"))]
@@ -28,4 +28,6 @@ pub fn launch(
.launch()
.await;
});
panic!("Launching a liveview app should never return")
}