diff --git a/app/src-tauri/src/claude_code.rs b/app/src-tauri/src/claude_code.rs index c70f960cc0..7ff7a98ed3 100644 --- a/app/src-tauri/src/claude_code.rs +++ b/app/src-tauri/src/claude_code.rs @@ -43,7 +43,7 @@ end tell"#; .args(["-e", script]) .spawn() .map_err(|e| format!("failed to open Terminal.app: {e}"))?; - return Ok("Terminal.app".into()); + Ok("Terminal.app".into()) } #[cfg(target_os = "linux")] diff --git a/app/src-tauri/src/imessage_scanner/mod.rs b/app/src-tauri/src/imessage_scanner/mod.rs index 289fd7cac0..e8cefd9929 100644 --- a/app/src-tauri/src/imessage_scanner/mod.rs +++ b/app/src-tauri/src/imessage_scanner/mod.rs @@ -372,7 +372,7 @@ fn extract_text_from_attributed_body(blob: &[u8]) -> Option { .filter_map(|r| String::from_utf8(r).ok()) .filter(|s| { let trimmed = s.trim(); - trimmed.len() >= 2 && !ignored_markers.iter().any(|m| trimmed == *m) + trimmed.len() >= 2 && !ignored_markers.contains(&trimmed) }) .max_by_key(|s| s.len()) .map(|s| s.trim().to_string()) diff --git a/app/src-tauri/src/lib.rs b/app/src-tauri/src/lib.rs index ee15b7897e..b597458325 100644 --- a/app/src-tauri/src/lib.rs +++ b/app/src-tauri/src/lib.rs @@ -1195,7 +1195,7 @@ fn mascot_window_show(app: AppHandle) -> Result<(), String> { log::info!("[mascot-window] show requested"); #[cfg(target_os = "macos")] { - return mascot_native_window::show(&app); + mascot_native_window::show(&app) } #[cfg(not(target_os = "macos"))] { @@ -1258,11 +1258,11 @@ fn notch_window_show(app: AppHandle) -> Result<(), String> { log::info!("[notch-window] show requested"); #[cfg(target_os = "macos")] { - return dispatch_notch_on_main(app, |app| { + dispatch_notch_on_main(app, |app| { if let Err(e) = notch_window::show(app) { log::warn!("[notch-window] show failed: {e}"); } - }); + }) } #[cfg(not(target_os = "macos"))] { @@ -1277,7 +1277,7 @@ fn notch_window_hide(app: AppHandle) -> Result<(), String> { log::info!("[notch-window] hide requested"); #[cfg(target_os = "macos")] { - return dispatch_notch_on_main(app, |_app| notch_window::hide()); + dispatch_notch_on_main(app, |_app| notch_window::hide()) } #[cfg(not(target_os = "macos"))] { diff --git a/app/src-tauri/src/mascot_native_window.rs b/app/src-tauri/src/mascot_native_window.rs index 063361a356..5c27a36ea2 100644 --- a/app/src-tauri/src/mascot_native_window.rs +++ b/app/src-tauri/src/mascot_native_window.rs @@ -52,6 +52,9 @@ const DRAG_POLL_SECONDS: f64 = 0.016; /// dropped webview. struct MascotPanel { panel: Retained, + // RAII keep-alive: never read, but dropping it deallocates the WKWebView and + // blanks the panel. Must outlive the show/hide cycle — do not remove. + #[allow(dead_code)] webview: Retained, drag_timer: Retained, } @@ -389,7 +392,7 @@ unsafe fn build_webview( let _: () = msg_send![&*webview, setAutoresizingMask: 18u64]; // width|height // Make the webview the panel's content view so it fills the frame. - let webview_ref: &objc2::runtime::AnyObject = &*webview; + let webview_ref: &objc2::runtime::AnyObject = &webview; let webview_view: *mut objc2::runtime::AnyObject = webview_ref as *const _ as *mut objc2::runtime::AnyObject; let _: () = msg_send![panel, setContentView: webview_view]; diff --git a/app/src-tauri/src/native_notifications/mod.rs b/app/src-tauri/src/native_notifications/mod.rs index 7fb5281e7d..18e23669a7 100644 --- a/app/src-tauri/src/native_notifications/mod.rs +++ b/app/src-tauri/src/native_notifications/mod.rs @@ -37,7 +37,7 @@ use crate::AppRuntime; pub fn notification_permission_state() -> Result { #[cfg(target_os = "macos")] { - return macos::permission_state(); + macos::permission_state() } #[cfg(not(target_os = "macos"))] { @@ -51,7 +51,7 @@ pub fn notification_permission_state() -> Result { pub fn notification_permission_request() -> Result { #[cfg(target_os = "macos")] { - return macos::request_permission(); + macos::request_permission() } #[cfg(not(target_os = "macos"))] { diff --git a/app/src-tauri/src/notch_window.rs b/app/src-tauri/src/notch_window.rs index 78653688cb..4fc3f7202a 100644 --- a/app/src-tauri/src/notch_window.rs +++ b/app/src-tauri/src/notch_window.rs @@ -61,10 +61,6 @@ thread_local! { static NOTCH: RefCell> = const { RefCell::new(None) }; } -pub(crate) fn is_open() -> bool { - NOTCH.with(|cell| cell.borrow().is_some()) -} - pub(crate) fn hide() { NOTCH.with(|cell| { if let Some(existing) = cell.borrow_mut().take() { @@ -262,7 +258,7 @@ unsafe fn build_webview( // Auto-resize to fill the panel content view. let _: () = msg_send![&*webview, setAutoresizingMask: 18u64]; // width|height - let webview_ref: &objc2::runtime::AnyObject = &*webview; + let webview_ref: &objc2::runtime::AnyObject = &webview; let webview_view = webview_ref as *const _ as *mut objc2::runtime::AnyObject; let _: () = msg_send![panel, setContentView: webview_view];