Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

style(desktop): collapse nested if into let-chain

Richie McIlroya7e73c8da30d
diff --git a/apps/desktop/src-tauri/src/frame_ws.rs b/apps/desktop/src-tauri/src/frame_ws.rs
index 3d959e4a9..0bc073439 100644
--- a/apps/desktop/src-tauri/src/frame_ws.rs
+++ b/apps/desktop/src-tauri/src/frame_ws.rs
@@ -138,11 +138,11 @@ pub async fn create_watch_frame_ws(
let borrowed = camera_rx.borrow();
borrowed.as_deref().map(pack_ws_frame_ref)
};
- if let Some(packed) = packed {
- if let Err(e) = socket.send(Message::Binary(packed)).await {
- tracing::error!("Failed to send initial frame to socket: {:?}", e);
- return;
- }
+ if let Some(packed) = packed
+ && let Err(e) = socket.send(Message::Binary(packed)).await
+ {
+ tracing::error!("Failed to send initial frame to socket: {:?}", e);
+ return;
}
}