on master help sign in
cfg-gate unused functions on macos & windows (#2332)
commit77ff8d355051ef567c7998b226e28ba436c2e230 authorKirawi <67773714+kirawi@users.noreply.github.com> dateMon 2 May 2022, 10:31 (4 years ago) parent20162a4
1 file changed+4
helix-view/src/clipboard.rs+4
helix-view/src/clipboard.rs+4
@@ -14,6 +14,7 @@ pub trait ClipboardProvider: std::fmt::Debug {
1414 fn set_contents(&mut self, contents: String, clipboard_type: ClipboardType) -> Result<()>;
1515}
1616
17+#[cfg(not(windows))]
1718macro_rules! command_provider {
1819 (paste => $get_prg:literal $( , $get_arg:literal )* ; copy => $set_prg:literal $( , $set_arg:literal )* ; ) => {{
1920 Box::new(provider::command::Provider {
@@ -212,14 +213,17 @@ mod provider {
212213 use super::*;
213214 use anyhow::{bail, Context as _, Result};
214215
216+ #[cfg(not(windows))]
215217 pub fn exists(executable_name: &str) -> bool {
216218 which::which(executable_name).is_ok()
217219 }
218220
221+ #[cfg(not(any(windows, target_os = "macos")))]
219222 pub fn env_var_is_set(env_var_name: &str) -> bool {
220223 std::env::var_os(env_var_name).is_some()
221224 }
222225
226+ #[cfg(not(any(windows, target_os = "macos")))]
223227 pub fn is_exit_success(program: &str, args: &[&str]) -> bool {
224228 std::process::Command::new(program)
225229 .args(args)