You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: install.rs
    path of file: ./repos/workers-rs/worker-build/src
    
    the code of the file until where you have to start completion: use std::{fs::OpenOptions, io::Write, path::PathBuf, process::Command};

use anyhow::Result;
use flate2::read::GzDecoder;

/// Checks if a binary with the specified name is on the user's path.
pub fn is_installed(name: &str) -> Result<Option<PathBuf>> {
    let path = std::env::var_os("PATH").expect("could not read PATH environment variable");
    let path_directories = std::env::split_paths(&path).filter_map(|path| {
        std::fs::metadata(&path)
            .ok()
            .map(|meta| meta.is_dir())
            .unwrap_or(false)
            .then_some(path)
    });

    for dir in path_directories {
        for entry in dir.read_dir()? {
            let entry = entry?;
            let file_type = entry.file_type()?;
            let is_file_or_symlink = file_type.is_symlink() || file_type
    
pub fn is_installed(name: &str) -> Result<Option<PathBuf>> {
    let path = std::env::var_os("PATH").expect("could not read PATH environment variable");
    let path_directories = std::env::split_paths(&path).filter_map(|path| {
        std::fs::metadata(&path)
            .ok()
            .map(|meta| meta.is_dir())
            .unwrap_or(false)
            .then_some(path)
    });

    for dir in path_directories {
        for entry in dir.read_dir()? {
            let entry = entry?;
            let file_type = entry.file_type()?;
            let is_file_or_symlink = file_type.is_symlink() || file_type.is_file();

            if is_file_or_symlink
                && entry.file_name() == format!("{name}{BINARY_EXTENSION}").as_str()
            {
                return Ok(Some(entry.path()));
            }
        }
    }

    Ok(None)
}