Skip to content

Commit 2f6da91

Browse files
committed
clippy
1 parent b4b623a commit 2f6da91

2 files changed

Lines changed: 11 additions & 19 deletions

File tree

apps/desktop/src-tauri/src/fake_window.rs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,15 @@ pub fn spawn_fake_window_listener(app: AppHandle, window: WebviewWindow) {
8282
loop {
8383
sleep(Duration::from_millis(1000 / 20)).await;
8484

85-
if is_recording_controls {
86-
if let Some(cursor_display_id) = get_display_id_for_cursor() {
87-
let display_changed = current_display_id
88-
.as_ref()
89-
.map_or(true, |id| id != &cursor_display_id);
90-
91-
if display_changed {
92-
if let Some(display) = get_display_by_id(&cursor_display_id) {
93-
if let Some((pos_x, pos_y)) = calculate_bottom_center_position(&display)
94-
{
95-
let _ =
96-
window.set_position(tauri::LogicalPosition::new(pos_x, pos_y));
97-
current_display_id = Some(cursor_display_id);
98-
}
99-
}
100-
}
85+
if is_recording_controls && let Some(cursor_display_id) = get_display_id_for_cursor() {
86+
let display_changed = current_display_id.as_ref() != Some(&cursor_display_id);
87+
88+
if display_changed
89+
&& let Some(display) = get_display_by_id(&cursor_display_id)
90+
&& let Some((pos_x, pos_y)) = calculate_bottom_center_position(&display)
91+
{
92+
let _ = window.set_position(tauri::LogicalPosition::new(pos_x, pos_y));
93+
current_display_id = Some(cursor_display_id);
10194
}
10295
}
10396

apps/desktop/src-tauri/src/target_select_overlay.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@ pub async fn open_target_select_overlays(
124124
if let Ok(CapWindowId::TargetSelectOverlay {
125125
display_id: existing_id,
126126
}) = CapWindowId::from_str(&id)
127+
&& existing_id != display_id
127128
{
128-
if existing_id != display_id {
129-
let _ = window.close();
130-
}
129+
let _ = window.close();
131130
}
132131
}
133132

0 commit comments

Comments
 (0)