try not double boxing
This commit is contained in:
1 parent
0c532c5e0c
commit
dab87c0144
11 files changed
+166
-103
No files matched your search
@@ -10,10 +10,7 @@ use tao::event::{Event, StartCause, WindowEvent};
|
||||
///
|
||||
/// This will block the main thread, and *must* be spawned on the main thread. This function does not assume any runtime
|
||||
/// and is equivalent to calling launch_with_props with the tokio feature disabled.
|
||||
pub fn launch_with_props_blocking<Props: Clone + 'static>(
|
||||
dioxus_cfg: CrossPlatformConfig<Props>,
|
||||
desktop_config: Config,
|
||||
) {
|
||||
pub fn launch_with_props_blocking(dioxus_cfg: CrossPlatformConfig, desktop_config: Config) {
|
||||
let (event_loop, mut app) = App::new(desktop_config, dioxus_cfg);
|
||||
|
||||
event_loop.run(move |window_event, _, control_flow| {
|
||||
@@ -53,10 +50,10 @@ pub fn launch_with_props_blocking<Props: Clone + 'static>(
|
||||
/// The desktop renderer platform
|
||||
pub struct DesktopPlatform;
|
||||
|
||||
impl<Props: Clone + 'static> PlatformBuilder<Props> for DesktopPlatform {
|
||||
impl PlatformBuilder for DesktopPlatform {
|
||||
type Config = Config;
|
||||
|
||||
fn launch(config: dioxus_core::CrossPlatformConfig<Props>, platform_config: Self::Config) {
|
||||
fn launch(config: dioxus_core::CrossPlatformConfig, platform_config: Self::Config) {
|
||||
#[cfg(feature = "tokio")]
|
||||
tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
|
||||
Reference in new issue
Block a user