mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-17 11:45:05 +02:00
Fix Rust warnings (#4872)
# Description of Changes Fix warnings in Rust code on Mac. They were all being caused by file handling logic which is now built into Tauri, so I've just been able to remove all of the Mac specific file handling code. I've also set warnings to be treated as errors because it'll be really easy to accidentally introudce warnings on individual platforms which I'm not developing, and I'd like to know about them so we can fix it before getting dodgy code.
This commit is contained in:
@@ -5,6 +5,7 @@ use std::sync::Mutex;
|
||||
static OPENED_FILE: Mutex<Option<String>> = Mutex::new(None);
|
||||
|
||||
// Set the opened file path (called by macOS file open events)
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn set_opened_file(file_path: String) {
|
||||
let mut opened_file = OPENED_FILE.lock().unwrap();
|
||||
*opened_file = Some(file_path.clone());
|
||||
|
||||
@@ -4,4 +4,6 @@ pub mod files;
|
||||
|
||||
pub use backend::{start_backend, cleanup_backend};
|
||||
pub use health::check_backend_health;
|
||||
pub use files::{get_opened_file, clear_opened_file, set_opened_file};
|
||||
pub use files::{get_opened_file, clear_opened_file};
|
||||
#[cfg(target_os = "macos")]
|
||||
pub use files::set_opened_file;
|
||||
|
||||
Reference in New Issue
Block a user