INNER CODE UNIT · Rust

Ok

ngless-toolkit/ngless · src/lib.rs:245

    if let Ok(bin) = std::env::var(envvar) {
        let path = std::path::Path::new(&bin);
        if !path.is_file() {
            return Err(NgError::new(
                NgErrorType::SystemError,
                format!("{envvar} binary not found!\nExpected it at {bin}"),
            ));
        }
        if !is_executable(path) {
            return Err(NgError::new(
                NgErrorType::SystemError,
                format!("{envvar} binary found at {bin}.\nHowever, it is not an executable file!"),
            ));
        }
        return Ok(bin);
    }
    match find_on_path(fname) {
        Some(p) => Ok(p),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…