From f9f49285c5ecc76d3edfb0a54ffab53c2e296d7f Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 26 Feb 2022 18:57:55 +0100 Subject: Apply linter advices --- src/gui/utils.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/gui/utils.rs (limited to 'src/gui/utils.rs') diff --git a/src/gui/utils.rs b/src/gui/utils.rs new file mode 100644 index 0000000..673b96e --- /dev/null +++ b/src/gui/utils.rs @@ -0,0 +1,9 @@ +use std::future::Future; + +/// Spawns a task on the default executor, without waiting for it to complete +pub fn spawn(future: F) +where + F: Future + 'static, +{ + gtk4::glib::MainContext::default().spawn_local(future); +} -- cgit v1.2.3