From ae5a2502d676f6065315b19132430243575e934b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Sat, 17 Oct 2020 08:46:16 +0200 Subject: [PATCH] Remove `executor::Null` from the root public API Using an `Application` with `executor::Null` does not make sense, as the whole purpose of an `Application` is to allow executing async actions. When async actions are not needed, `Sandbox` should be used instead. --- src/application.rs | 2 +- src/executor.rs | 2 +- src/sandbox.rs | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/application.rs b/src/application.rs index d46cd2ac..d9e25ad4 100644 --- a/src/application.rs +++ b/src/application.rs @@ -65,7 +65,7 @@ use crate::{Color, Command, Element, Executor, Settings, Subscription}; /// struct Hello; /// /// impl Application for Hello { -/// type Executor = executor::Null; +/// type Executor = executor::Default; /// type Message = (); /// type Flags = (); /// diff --git a/src/executor.rs b/src/executor.rs index 59d59a5a..ea6ab14a 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -1,5 +1,5 @@ //! Choose your preferred executor to power your application. -pub use crate::runtime::{executor::Null, Executor}; +pub use crate::runtime::Executor; pub use platform::Default; diff --git a/src/sandbox.rs b/src/sandbox.rs index c72b58d8..5a668e39 100644 --- a/src/sandbox.rs +++ b/src/sandbox.rs @@ -1,4 +1,3 @@ -use crate::executor; use crate::{ Application, Color, Command, Element, Error, Settings, Subscription, }; @@ -172,7 +171,7 @@ impl Application for T where T: Sandbox, { - type Executor = executor::Null; + type Executor = crate::runtime::executor::Null; type Flags = (); type Message = T::Message;