fn load_decls() -> FuncTypeMap {
    // Create a path to the desired file
    let path = Path::new(INFER_FILE);
    let _display = path.display();

    // Open the path in read-only mode, returns `io::Result<File>`
    let mut file = match File::open(&path) {
        // The `description` method of `io::Error` returns a string that describes the error
        Err(_why) => return HashMap::new(),
        Ok(file) => file
    };
    // Read the file contents into a string, returns `io::Result<usize>`
    let mut s = String::new();
    match file.read_to_string(&mut s) {
        Err(_why) => return HashMap::new(),
        Ok(_) => {}
    };
    // println!("load_decls: {}, {:#?}", display, s);
    let all_funcs: FuncTypeMap = json::decode(&s).unwrap();
    return all_funcs;
}
/// Load the function declarations from a JSON file.
Load the function declarations from a JSON file.
Load the function declarations from a JSON file .
fn load_decls() -> FuncTypeMap {
    // Create a path to the desired file
    let path = Path::new(INFER_FILE);
    let _display = path.display();
    // Open the path in read-only mode, returns `io::Result<File>`
    let mut file = match File::open(&path) {
        // The `description` method of `io::Error` returns a string that describes the error
        Err(_why) => return HashMap::new(),
        Ok(file) => file
    };
    // Read the file contents into a string, returns `io::Result<usize>`
    let mut s = String::new();
    match file.read_to_string(&mut s) {
        Err(_why) => return HashMap::new(),
        Ok(_) => {}
    };
    // println!("load_decls: {}, {:#?}", display, s);
    let all_funcs: FuncTypeMap = json::decode(&s).unwrap();
    return all_funcs;
}
fn load_decls ( ) -> FuncTypeMap { // Create a path to the desired file let path = Path :: new ( INFER_FILE ) ; let _display = path . display ( ) ; // Open the path in read-only mode, returns `io::Result<File>` let mut file = match File :: open ( & path ) { // The `description` method of `io::Error` returns a string that describes the error Err ( _why ) => return HashMap :: new ( ) , Ok ( file ) => file } ; // Read the file contents into a string, returns `io::Result<usize>` let mut s = String :: new ( ) ; match file . read_to_string ( & mut s ) { Err ( _why ) => return HashMap :: new ( ) , Ok ( _ ) => { } } ; // println!("load_decls: {}, {:#?}", display, s); let all_funcs : FuncTypeMap = json :: decode ( & s ) . unwrap ( ) ; return all_funcs ; }
Load the function declarations from a JSON file.
Load the function declarations from a JSON file .