Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src-tauri/src/claude_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/src/imessage_scanner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ fn extract_text_from_attributed_body(blob: &[u8]) -> Option<String> {
.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())
Expand Down
8 changes: 4 additions & 4 deletions app/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ fn mascot_window_show(app: AppHandle<AppRuntime>) -> 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"))]
{
Expand Down Expand Up @@ -1258,11 +1258,11 @@ fn notch_window_show(app: AppHandle<AppRuntime>) -> 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"))]
{
Expand All @@ -1277,7 +1277,7 @@ fn notch_window_hide(app: AppHandle<AppRuntime>) -> 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"))]
{
Expand Down
5 changes: 4 additions & 1 deletion app/src-tauri/src/mascot_native_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ const DRAG_POLL_SECONDS: f64 = 0.016;
/// dropped webview.
struct MascotPanel {
panel: Retained<NSPanel>,
// 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<WKWebView>,
drag_timer: Retained<NSTimer>,
}
Expand Down Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions app/src-tauri/src/native_notifications/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use crate::AppRuntime;
pub fn notification_permission_state() -> Result<String, String> {
#[cfg(target_os = "macos")]
{
return macos::permission_state();
macos::permission_state()
}
#[cfg(not(target_os = "macos"))]
{
Expand All @@ -51,7 +51,7 @@ pub fn notification_permission_state() -> Result<String, String> {
pub fn notification_permission_request() -> Result<String, String> {
#[cfg(target_os = "macos")]
{
return macos::request_permission();
macos::request_permission()
}
#[cfg(not(target_os = "macos"))]
{
Expand Down
6 changes: 1 addition & 5 deletions app/src-tauri/src/notch_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ thread_local! {
static NOTCH: RefCell<Option<NotchPanel>> = 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() {
Expand Down Expand Up @@ -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];

Expand Down
Loading