pub fn find_wasm_opt(
    cache: &Cache,
    install_permitted: bool,
) -> Result<install::Status, failure::Error> {
    // First attempt to look up in PATH. If found assume it works.
    if let Ok(path) = which::which("wasm-opt") {
        PBAR.info(&format!("found wasm-opt at {:?}", path));

        match path.as_path().parent() {
            Some(path) => return Ok(install::Status::Found(Download::at(path))),
            None => {}
        }
    }

    let version = "version_78";
    Ok(install::download_prebuilt(
        &install::Tool::WasmOpt,
        cache,
        version,
        install_permitted,
    )?)
}
/// Attempts to find `wasm-opt` in `PATH` locally, or failing that downloads a
/// precompiled binary.
///
/// Returns `Some` if a binary was found or it was successfully downloaded.
/// Returns `None` if a binary wasn't found in `PATH` and this platform doesn't
/// have precompiled binaries. Returns an error if we failed to download the
/// binary.
Attempts to find `wasm-opt` in `PATH` locally, or failing that downloads a
precompiled binary.

Returns `Some` if a binary was found or it was successfully downloaded.
Returns `None` if a binary wasn't found in `PATH` and this platform doesn't
have precompiled binaries. Returns an error if we failed to download the
binary.
Attempts to find ` wasm - opt ` in ` PATH ` locally or failing that downloads a precompiled binary . Returns ` Some ` if a binary was found or it was successfully downloaded . Returns ` None ` if a binary wasn ' t found in ` PATH ` and this platform doesn ' t have precompiled binaries . Returns an error if we failed to download the binary .
pub fn find_wasm_opt(
    cache: &Cache,
    install_permitted: bool,
) -> Result<install::Status, failure::Error> {
    // First attempt to look up in PATH. If found assume it works.
    if let Ok(path) = which::which("wasm-opt") {
        PBAR.info(&format!("found wasm-opt at {:?}", path));
        match path.as_path().parent() {
            Some(path) => return Ok(install::Status::Found(Download::at(path))),
            None => {}
        }
    }
    let version = "version_78";
    Ok(install::download_prebuilt(
        &install::Tool::WasmOpt,
        cache,
        version,
        install_permitted,
    )?)
}
pub fn find_wasm_opt ( cache : & Cache , install_permitted : bool , ) -> Result < install :: Status , failure :: Error > { // First attempt to look up in PATH. If found assume it works. if let Ok ( path ) = which :: which ( " " ) { PBAR . info ( & format ! ( " " path ) ) ; match path . as_path ( ) . parent ( ) { Some ( path ) => return Ok ( install :: Status :: Found ( Download :: at ( path ) ) ) , None => { } } } let version = " " ; Ok ( install :: download_prebuilt ( & install :: Tool :: WasmOpt , cache , version , install_permitted , ) ? ) }
Attempts to find `wasm-opt` in `PATH` locally, or failing that downloads a
precompiled binary.
Attempts to find ` wasm - opt ` in ` PATH ` locally or failing that downloads a precompiled binary .
cache
&Cache
install_permitted
bool