Simplify async code

- Update Cargo.lock
- Use new gtk-core API
- Remove unneeded async
- Remove unneeded clones

Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/310>
This commit is contained in:
Julian Hofer 2023-11-22 09:12:07 +01:00
parent 8d185e1e10
commit cd8188a1bb
10 changed files with 26 additions and 40 deletions

View file

@ -247,10 +247,3 @@ pub fn contrast_ratio(color1: &gdk::RGBA, color2: &gdk::RGBA) -> f32 {
(l1 + 0.05) / (l2 + 0.05)
}
pub fn spawn<R: 'static, F: std::future::Future<Output = R> + 'static>(
f: F,
) -> glib::JoinHandle<R> {
let ctx = glib::MainContext::default();
ctx.spawn_local(f)
}