fn rustfmt_path() -> &'static Path {
    // lazy static var
    static mut PATH: Option<PathBuf> = None;

    if let Some(path) = unsafe { PATH.as_ref() } {
        return path;
    }

    if let Ok(path) = std::env::var("RUSTFMT") {
        unsafe {
            PATH = Some(PathBuf::from(path));
            PATH.as_ref().unwrap()
        }
    } else {
        // assume it is in PATH
        unsafe {
            PATH = Some(which("rustmft").unwrap_or_else(|_| "rustfmt".into()));
            PATH.as_ref().unwrap()
        }
    }
}
/// Get the rustfmt binary path.
Get the rustfmt binary path.
Get the rustfmt binary path .
fn rustfmt_path() -> &'static Path {
    // lazy static var
    static mut PATH: Option<PathBuf> = None;
    if let Some(path) = unsafe { PATH.as_ref() } {
        return path;
    }
    if let Ok(path) = std::env::var("RUSTFMT") {
        unsafe {
            PATH = Some(PathBuf::from(path));
            PATH.as_ref().unwrap()
        }
    } else {
        // assume it is in PATH
        unsafe {
            PATH = Some(which("rustmft").unwrap_or_else(|_| "rustfmt".into()));
            PATH.as_ref().unwrap()
        }
    }
}
fn rustfmt_path ( ) -> & ' static Path { // lazy static var static mut PATH : Option < PathBuf > = None ; if let Some ( path ) = unsafe { PATH . as_ref ( ) } { return path ; } if let Ok ( path ) = std :: env :: var ( " " ) { unsafe { PATH = Some ( PathBuf :: from ( path ) ) ; PATH . as_ref ( ) . unwrap ( ) } } else { // assume it is in PATH unsafe { PATH = Some ( which ( " " ) . unwrap_or_else ( | _ | " " . into ( ) ) ) ; PATH . as_ref ( ) . unwrap ( ) } } }
Get the rustfmt binary path.
Get the rustfmt binary path .