From 2af285d01dc55a964c3cdf6f5c49ea141b2e454b Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Mon, 16 Sep 2019 17:52:33 +0200 Subject: [PATCH] Fix warnings on macOS --- src/check.rs | 2 ++ src/context/macos.rs | 6 ++---- src/protocol/unix.rs | 4 +--- src/ui/macos.rs | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/check.rs b/src/check.rs index 6230e2e..aa85a66 100644 --- a/src/check.rs +++ b/src/check.rs @@ -50,6 +50,8 @@ pub fn check_dependencies() -> bool { #[cfg(target_os = "macos")] pub fn check_dependencies() -> bool { // TODO: check accessibility + + true } #[cfg(target_os = "windows")] diff --git a/src/context/macos.rs b/src/context/macos.rs index de80361..08e47d6 100644 --- a/src/context/macos.rs +++ b/src/context/macos.rs @@ -20,13 +20,11 @@ use std::sync::mpsc::Sender; use std::os::raw::c_void; use crate::bridge::macos::*; -use crate::event::{Event, KeyEvent, KeyModifier, ActionEvent, ActionType}; +use crate::event::{Event, KeyEvent, KeyModifier, ActionType}; use crate::event::KeyModifier::*; -use std::fs::create_dir_all; use std::ffi::CString; use std::fs; use log::{info, error}; -use std::path::PathBuf; use std::process::exit; const STATUS_ICON_BINARY : &'static [u8] = include_bytes!("../res/mac/icon.png"); @@ -54,7 +52,7 @@ impl MacContext { }); // Initialize the status icon path - let espanso_dir = MacContext::get_data_dir(); + let espanso_dir = super::get_data_dir(); let status_icon_target = espanso_dir.join("icon.png"); if status_icon_target.exists() { diff --git a/src/protocol/unix.rs b/src/protocol/unix.rs index 30ce59c..abdb08a 100644 --- a/src/protocol/unix.rs +++ b/src/protocol/unix.rs @@ -17,10 +17,8 @@ * along with espanso. If not, see . */ -use std::io::{BufReader, Read}; -use std::io::Write; use std::os::unix::net::{UnixStream,UnixListener}; -use log::{info, error, warn}; +use log::{info, warn}; use std::sync::mpsc::Sender; use super::IPCCommand; diff --git a/src/ui/macos.rs b/src/ui/macos.rs index 29e4b50..8bcf791 100644 --- a/src/ui/macos.rs +++ b/src/ui/macos.rs @@ -24,9 +24,9 @@ use log::{info, warn, debug}; use std::path::PathBuf; use std::process::Command; use crate::ui::{MenuItem, MenuItemType}; -use crate::context::macos::MacContext; use crate::bridge::macos::{MacMenuItem, show_context_menu}; use std::os::raw::c_char; +use crate::context; const NOTIFY_HELPER_BINARY : &'static [u8] = include_bytes!("../res/mac/EspansoNotifyHelper.zip"); const DEFAULT_NOTIFICATION_DELAY : f64 = 1.5; @@ -92,7 +92,7 @@ impl MacUIManager { } fn initialize_notify_helper() -> PathBuf { - let espanso_dir = MacContext::get_data_dir(); + let espanso_dir = context::get_data_dir(); info!("Initializing EspansoNotifyHelper in {}", espanso_dir.as_path().display());