diff options
author | Joris | 2022-01-09 13:12:45 +0100 |
---|---|---|
committer | Joris | 2022-01-09 13:12:45 +0100 |
commit | 99af88a840bef534540a4b273d24a8a17e7fc9b9 (patch) | |
tree | 20bda6c9eccd66d0c165e1f5d42fe76f80be58d2 /src/app/utils.rs | |
parent | bd59a5128c05dcd550e91bbdd0cd9d5996a65586 (diff) |
Split app into modules
Diffstat (limited to 'src/app/utils.rs')
-rw-r--r-- | src/app/utils.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app/utils.rs b/src/app/utils.rs new file mode 100644 index 0000000..673b96e --- /dev/null +++ b/src/app/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<F>(future: F) +where + F: Future<Output = ()> + 'static, +{ + gtk4::glib::MainContext::default().spawn_local(future); +} |