Skip to content

Commit 15204c1

Browse files
committed
Clean up + clippy + cargo fmt
1 parent 17c43f3 commit 15204c1

7 files changed

Lines changed: 7 additions & 64 deletions

File tree

apps/desktop/src-tauri/src/platform/macos/mod.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
mod sc_shareable_content;
22

3-
use block2::RcBlock;
43
use objc2::{msg_send, sel};
5-
use objc2_foundation::NSObjectProtocol;
6-
use objc2_web_kit::WKWebView;
74
pub use sc_shareable_content::*;
8-
use tauri::WebviewWindow;
95

106
pub fn set_window_level(window: tauri::Window, level: objc2_app_kit::NSWindowLevel) {
117
let c_window = window.clone();
@@ -382,29 +378,3 @@ unsafe fn force_glass_view_always_active(glass_view: cocoa::base::id) {
382378
}
383379
}
384380
}
385-
386-
// pub fn get_ns_window_number(ns_window: *mut c_void) -> isize {
387-
// let ns_window = ns_window as *const objc2_app_kit::NSWindow;
388-
389-
// unsafe { (*ns_window).windowNumber() }
390-
// }
391-
392-
// #[link(name = "CoreGraphics", kind = "framework")]
393-
// unsafe extern "C" {
394-
// pub fn CGRectMakeWithDictionaryRepresentation(
395-
// dict: CFDictionaryRef,
396-
// rect: *mut CGRect,
397-
// ) -> boolean_t;
398-
// }
399-
400-
// /// Makes the background of the WKWebView layer transparent.
401-
// /// This differs from Tauri's implementation as it does not change the window background which causes performance performance issues and artifacts when shadows are enabled on the window.
402-
// /// Use Tauri's implementation to make the window itself transparent.
403-
// pub fn make_webview_transparent(target: &tauri::WebviewWindow) -> tauri::Result<()> {
404-
// target.with_webview(|webview| unsafe {
405-
// let wkwebview = webview.inner() as id;
406-
// let no: id = msg_send![class!(NSNumber), numberWithBool:0];
407-
// // [https://developer.apple.com/documentation/webkit/webview/1408486-drawsbackground]
408-
// let _: id = msg_send![wkwebview, setValue:no forKey: NSString::alloc(nil).init_str("drawsBackground")];
409-
// })
410-
// }

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

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -694,24 +694,6 @@ impl CapWindowId {
694694
)
695695
}
696696

697-
pub fn is_transparent(&self) -> bool {
698-
if matches!(self, Self::Settings) {
699-
return cfg!(target_os = "macos");
700-
}
701-
702-
matches!(
703-
self,
704-
Self::Main
705-
| Self::Onboarding
706-
| Self::Camera
707-
| Self::WindowCaptureOccluder { .. }
708-
| Self::CaptureArea
709-
| Self::RecordingControls
710-
| Self::RecordingsOverlay
711-
| Self::TargetSelectOverlay { .. }
712-
)
713-
}
714-
715697
pub fn get(&self, app: &AppHandle<Wry>) -> Option<WebviewWindow> {
716698
if matches!(self, Self::Camera) {
717699
return current_camera_window(app);
@@ -1230,7 +1212,7 @@ impl CapWindow {
12301212
let should_protect = should_protect_window(app, &title);
12311213

12321214
#[cfg(target_os = "macos")]
1233-
let panel_activation_guard = permissions::prepare_macos_panel_window(app);
1215+
let _panel_activation_guard = permissions::prepare_macos_panel_window(app);
12341216

12351217
let window = self
12361218
.window_builder(app, "/")
@@ -2114,7 +2096,7 @@ impl CapWindow {
21142096
app.run_on_main_thread({
21152097
let window = window.clone();
21162098
let app = app.clone();
2117-
let panel_activation_guard = panel_activation_guard;
2099+
let _panel_activation_guard = panel_activation_guard;
21182100
move || {
21192101
use tauri_nspanel::cocoa::appkit::{NSWindowCollectionBehavior, NSWindowStyleMask};
21202102
use tauri_nspanel::panel_delegate;
@@ -2496,7 +2478,6 @@ pub async fn apply_macos_liquid_glass_background(
24962478
}
24972479
}
24982480

2499-
25002481
#[specta::specta]
25012482
#[tauri::command(async)]
25022483
#[instrument(skip(_window))]

crates/recording/src/output_pipeline/core.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,8 +1858,7 @@ fn spawn_video_encoder<TMutex: VideoMuxer<VideoFrame = TVideo::Frame>, TVideo: V
18581858
Ok(d) => d,
18591859
Err(TimestampAnomalyError::TooManyConsecutiveAnomalies { count }) => {
18601860
return Err(anyhow!(
1861-
"Video stream timestamp anomaly: {} consecutive anomalies exceeded threshold",
1862-
count
1861+
"Video stream timestamp anomaly: {count} consecutive anomalies exceeded threshold"
18631862
));
18641863
}
18651864
};

crates/recording/src/output_pipeline/macos.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,7 @@ impl Muxer for AVFoundationMp4Muxer {
291291
info!(available_mb, "Disk space check before recording start");
292292
if available_mb < DISK_SPACE_MIN_START_MB {
293293
return Err(anyhow!(
294-
"Insufficient disk space to start recording: {}MB available, {}MB required",
295-
available_mb,
296-
DISK_SPACE_MIN_START_MB
294+
"Insufficient disk space to start recording: {available_mb}MB available, {DISK_SPACE_MIN_START_MB}MB required"
297295
));
298296
}
299297
}

crates/recording/src/screenshot.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,11 +1166,7 @@ fn convert_ffmpeg_frame_to_image(frame: &ffmpeg::frame::Video) -> anyhow::Result
11661166

11671167
if src_stride < dst_stride {
11681168
return Err(anyhow!(
1169-
"Source stride ({}) is less than destination stride ({}); width={}, height={}",
1170-
src_stride,
1171-
dst_stride,
1172-
width,
1173-
height
1169+
"Source stride ({src_stride}) is less than destination stride ({dst_stride}); width={width}, height={height}"
11741170
));
11751171
}
11761172

crates/recording/src/sources/screen_capture/macos.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,7 @@ impl output_pipeline::VideoSource for VideoSource {
745745
"Failed to restart macOS screen capture"
746746
);
747747
return Err(anyhow!(
748-
"Screen capture restart failed after {} attempts: {e}",
749-
restart_count
748+
"Screen capture restart failed after {restart_count} attempts: {e}"
750749
));
751750
}
752751
}

crates/recording/src/studio_recording.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ fn write_in_progress_meta(recording_dir: &Path) -> anyhow::Result<()> {
16511651
};
16521652

16531653
meta.save_for_project()
1654-
.map_err(|e| anyhow!("Failed to save in-progress meta: {:?}", e))
1654+
.map_err(|e| anyhow!("Failed to save in-progress meta: {e}"))
16551655
}
16561656

16571657
#[cfg(test)]

0 commit comments

Comments
 (0)