fn save_decls(all_funcs: &FuncTypeMap) {
    let encoded = json::encode(&all_funcs).unwrap();
    let path = Path::new(INFER_FILE);
    let display = path.display();
    // println!("save_decls: {}, {:#?}", display, encoded);
    // Open a file in write-only mode, returns `io::Result<File>`
    let mut file = match File::create(&path) {
        Err(why) => panic!("couldn't create {}: {}", display, why.to_string()),
        Ok(file) => file,
    };
    match file.write_all(encoded.as_bytes()) {
        Err(why) => panic!("couldn't write to {}: {}", display, why.to_string()),
        Ok(_) => println!("{}: updated {}", get_current_function(), display),
    };
}
/// Save the function declarations to a JSON file.
Save the function declarations to a JSON file.
Save the function declarations to a JSON file .
fn save_decls(all_funcs: &FuncTypeMap) {
    let encoded = json::encode(&all_funcs).unwrap();
    let path = Path::new(INFER_FILE);
    let display = path.display();
    // println!("save_decls: {}, {:#?}", display, encoded);
    // Open a file in write-only mode, returns `io::Result<File>`
    let mut file = match File::create(&path) {
        Err(why) => panic!("couldn't create {}: {}", display, why.to_string()),
        Ok(file) => file,
    };
    match file.write_all(encoded.as_bytes()) {
        Err(why) => panic!("couldn't write to {}: {}", display, why.to_string()),
        Ok(_) => println!("{}: updated {}", get_current_function(), display),
    };
}
fn save_decls ( all_funcs : & FuncTypeMap ) { let encoded = json :: encode ( & all_funcs ) . unwrap ( ) ; let path = Path :: new ( INFER_FILE ) ; let display = path . display ( ) ; // println!("save_decls: {}, {:#?}", display, encoded); // Open a file in write-only mode, returns `io::Result<File>` let mut file = match File :: create ( & path ) { Err ( why ) => panic ! ( " " display why to_string ( ) ) , Ok ( file ) => file , } ; match file . write_all ( encoded . as_bytes ( ) ) { Err ( why ) => panic ! ( " " display why to_string ( ) ) , Ok ( _ ) => println ! ( " " get_current_function ( ) display ) , } ; }
Save the function declarations to a JSON file.
Save the function declarations to a JSON file .
all_funcs
&FuncTypeMap
all_funcs
&FuncTypeMap