diff options
author | Michael Davis | 2024-01-23 14:29:07 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2024-01-24 06:47:49 +0000 |
commit | 6d724a8f331f4b2a8f1a001e990cf6129dc50b00 (patch) | |
tree | cc2d8c6068ec8ad58aa29320c08c6218b2e8070d /helix-term | |
parent | 6bfe1ddc53f542d62e242fd4aaf6748dda1b0e71 (diff) |
Re-export `which` from `helix-stdx::env`
We use `which::which` in many crates, so `which` was a separate
dependency across all of them. We can centralize `which` into the
stdx crate so it's easy for all crates to depend on it.
I also moved the rest of `helix-view/src/env.rs` into helix-stdx's
`env` module since it only contained a thin wrapper around `which`
and `std::env`.
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/Cargo.toml | 2 | ||||
-rw-r--r-- | helix-term/src/health.rs | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 683d6dc5..9a7162ac 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -35,8 +35,6 @@ helix-loader = { path = "../helix-loader" } anyhow = "1" once_cell = "1.19" -which = "5.0.0" - tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] } tui = { path = "../helix-tui", package = "helix-tui", default-features = false, features = ["crossterm"] } crossterm = { version = "0.27", features = ["event-stream"] } diff --git a/helix-term/src/health.rs b/helix-term/src/health.rs index 44ae2a2f..5f201926 100644 --- a/helix-term/src/health.rs +++ b/helix-term/src/health.rs @@ -182,7 +182,7 @@ pub fn languages_all() -> std::io::Result<()> { .sort_unstable_by_key(|l| l.language_id.clone()); let check_binary = |cmd: Option<&str>| match cmd { - Some(cmd) => match which::which(cmd) { + Some(cmd) => match helix_stdx::env::which(cmd) { Ok(_) => column(&format!("✓ {}", cmd), Color::Green), Err(_) => column(&format!("✘ {}", cmd), Color::Red), }, @@ -322,7 +322,7 @@ fn probe_protocols<'a, I: Iterator<Item = &'a str> + 'a>( writeln!(stdout)?; for cmd in server_cmds { - let (path, icon) = match which::which(cmd) { + let (path, icon) = match helix_stdx::env::which(cmd) { Ok(path) => (path.display().to_string().green(), "✓".green()), Err(_) => (format!("'{}' not found in $PATH", cmd).red(), "✘".red()), }; @@ -344,7 +344,7 @@ fn probe_protocol(protocol_name: &str, server_cmd: Option<String>) -> std::io::R writeln!(stdout, "Configured {}: {}", protocol_name, cmd_name)?; if let Some(cmd) = server_cmd { - let path = match which::which(&cmd) { + let path = match helix_stdx::env::which(&cmd) { Ok(path) => path.display().to_string().green(), Err(_) => format!("'{}' not found in $PATH", cmd).red(), }; |