From e5a796ed2eb5c24018c889a633ee63e215728952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 19 Oct 2024 17:31:47 +0300 Subject: [PATCH] examples: Remove unnecessary mutex Part-of: --- examples/src/glupload.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/src/glupload.rs b/examples/src/glupload.rs index 2a6903fd3..4b35d6c8c 100644 --- a/examples/src/glupload.rs +++ b/examples/src/glupload.rs @@ -11,7 +11,6 @@ use std::{ mem, num::NonZeroU32, ptr, - sync::Mutex, }; use anyhow::{Context, Result}; @@ -478,9 +477,7 @@ impl App { .context("Couldn't wrap GL context")?; let gl_context = shared_context.clone(); - // FIXME: Once MSRV is 1.72 the Mutex is not necessary anymore because - // std::sync::mpsc::Sender is Sync by itself - let event_proxy = Mutex::new(event_loop.create_proxy()); + let event_proxy = event_loop.create_proxy(); #[allow(clippy::single_match)] bus.set_sync_handler(move |_, msg| { @@ -513,7 +510,7 @@ impl App { _ => (), } - if let Err(e) = event_proxy.lock().unwrap().send_event(Message::BusEvent) { + if let Err(e) = event_proxy.send_event(Message::BusEvent) { eprintln!("Failed to send BusEvent to event proxy: {e}") }