Checking if a program exists in $PATH

Hello. I want to check whether a program exists in the $PATH without actually executing it, or printing its output in the console. Currently I'm using

pub fn inxi_exists() -> bool {
    std::process::Command::new("inxi").spawn().is_ok()
}

This prints the output of inxi to stdout which is not desirable.

https://doc.rust-lang.org/std/path/struct.Path.html#examples-28

This stackoverflow answer seems to be what you're looking for.
There is also the which crate.