diff --git a/crates/g3-computer-control/examples/safari_demo.rs b/crates/g3-computer-control/examples/safari_demo.rs index aed4c1e..b28ebd6 100644 --- a/crates/g3-computer-control/examples/safari_demo.rs +++ b/crates/g3-computer-control/examples/safari_demo.rs @@ -31,7 +31,7 @@ async fn main() -> Result<()> { // Find an element println!("Finding h1 element..."); - let mut h1 = driver.find_element("h1").await?; + let h1 = driver.find_element("h1").await?; let h1_text = h1.text().await?; println!("H1 text: {}\n", h1_text); diff --git a/crates/g3-computer-control/examples/test_permission_prompt.rs b/crates/g3-computer-control/examples/test_permission_prompt.rs index bf1d640..fdd5a4b 100644 --- a/crates/g3-computer-control/examples/test_permission_prompt.rs +++ b/crates/g3-computer-control/examples/test_permission_prompt.rs @@ -1,4 +1,4 @@ -use g3_computer_control::{create_controller, ComputerController}; +use g3_computer_control::create_controller; #[tokio::main] async fn main() { diff --git a/crates/g3-computer-control/examples/test_screenshot_fix.rs b/crates/g3-computer-control/examples/test_screenshot_fix.rs index bcfb60b..467da49 100644 --- a/crates/g3-computer-control/examples/test_screenshot_fix.rs +++ b/crates/g3-computer-control/examples/test_screenshot_fix.rs @@ -1,6 +1,5 @@ use core_graphics::display::CGDisplay; use image::{ImageBuffer, RgbaImage}; -use std::path::Path; fn main() { let display = CGDisplay::main(); diff --git a/crates/g3-computer-control/src/lib.rs b/crates/g3-computer-control/src/lib.rs index 2eb686c..e4180c6 100644 --- a/crates/g3-computer-control/src/lib.rs +++ b/crates/g3-computer-control/src/lib.rs @@ -1,3 +1,6 @@ +// Suppress warnings from objc crate macros +#![allow(unexpected_cfgs)] + pub mod types; pub mod platform; pub mod webdriver; diff --git a/crates/g3-computer-control/src/macax/controller.rs b/crates/g3-computer-control/src/macax/controller.rs index a887714..ac91ac1 100644 --- a/crates/g3-computer-control/src/macax/controller.rs +++ b/crates/g3-computer-control/src/macax/controller.rs @@ -11,9 +11,6 @@ use core_foundation::base::TCFType; #[cfg(target_os = "macos")] use core_foundation::string::CFString; -#[cfg(target_os = "macos")] -use core_foundation::boolean::CFBoolean; - /// macOS Accessibility API controller using native APIs pub struct MacAxController { // Cache for application elements @@ -202,7 +199,7 @@ impl MacAxController { /// Activate (bring to front) an application #[cfg(target_os = "macos")] pub fn activate_app(&self, app_name: &str) -> Result<()> { - use cocoa::base::{id, nil}; + use cocoa::base::id; use objc::{class, msg_send, sel, sel_impl}; // Find the app @@ -507,7 +504,6 @@ impl MacAxController { /// Type text into the currently focused element (uses system text input) #[cfg(target_os = "macos")] pub fn type_text(&self, app_name: &str, text: &str) -> Result<()> { - use cocoa::appkit::NSPasteboard; use cocoa::base::{id, nil}; use cocoa::foundation::NSString; use objc::{class, msg_send, sel, sel_impl};