use let-else where the match only guarded an exit

This commit is contained in:
2026-09-21 01:18:07 +03:00
parent 72f24b7369
commit 7c577eafd7
3 changed files with 9 additions and 16 deletions
+4 -6
View File
@@ -1161,9 +1161,8 @@ const OVERLAY_TITLEBAR_LOGICAL_PX: f64 = 24.0;
/// Remove temporary recording artifacts (segments, previews, thumbs).
/// Called on app exit so a discarded clip doesn't linger in `temp/`.
fn cleanup_temp_on_exit(app: &AppHandle) {
let st = match app.try_state::<AppState>() {
Some(s) => s,
None => return,
let Some(st) = app.try_state::<AppState>() else {
return;
};
clear_temp_segments(&st.app_dir, false);
}
@@ -1196,9 +1195,8 @@ fn start_overlay_clickthrough_poll(
}
}
let overlay = match app.get_webview_window("overlay") {
Some(w) => w,
None => continue,
let Some(overlay) = app.get_webview_window("overlay") else {
continue;
};
if !overlay.is_visible().unwrap_or(false) {
last_inner = None;