From e234d00592e20b9b2cb24a75fcbdcbe6fec568a5 Mon Sep 17 00:00:00 2001 From: Cyril Plisko Date: Tue, 25 Sep 2018 11:41:20 +0300 Subject: Drop utils::which --- src/utils.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index c97c4d7..2a87e31 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -47,18 +47,6 @@ pub fn pipe() -> (i32, i32) { (fds[0], fds[1]) } -fn which(exec: &str) -> Option { - if let Some(path) = env::var_os("PATH") { - for path in env::split_paths(&path) { - let candidate = path.join(exec); - if path.join(exec).exists() { - return Some(candidate.into_os_string()); - } - } - } - None -} - pub fn isatty(fd: i32) -> bool { let isatty = unsafe { libc::isatty(fd) }; isatty != 0 -- cgit v1.2.3