From 3197e52afd1727e90d4e4c5c93dbbb3c28a3cffc Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 6 Jun 2025 15:35:58 -0700 Subject: [PATCH] Unwrap user data in `cursor_image_status` This is added on creation of the seat, and unwrapped, when setting the status, so the `unwrap_or` case here seems unnecessary. --- src/shell/seats.rs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/shell/seats.rs b/src/shell/seats.rs index 8a17b500..c1f6dbae 100644 --- a/src/shell/seats.rs +++ b/src/shell/seats.rs @@ -377,19 +377,15 @@ impl SeatExt for Seat { } fn cursor_image_status(&self) -> CursorImageStatus { - self.user_data() - .get::>() - // Reset the cursor if the surface is no longer alive - .map(|lock| { - let mut cursor_status = lock.lock().unwrap(); - if let CursorImageStatus::Surface(ref surface) = *cursor_status { - if !surface.alive() { - *cursor_status = CursorImageStatus::default_named(); - } - } - cursor_status.clone() - }) - .unwrap_or(CursorImageStatus::default_named()) + let lock = self.user_data().get::>().unwrap(); + // Reset the cursor if the surface is no longer alive + let mut cursor_status = lock.lock().unwrap(); + if let CursorImageStatus::Surface(ref surface) = *cursor_status { + if !surface.alive() { + *cursor_status = CursorImageStatus::default_named(); + } + } + cursor_status.clone() } fn set_cursor_image_status(&self, status: CursorImageStatus) {