pub fn read_account(file_path: &str) -> Result<Account, String>{

    // Try to read the file
    let s = match read_file(&file_path) {
        Ok(s_val) => s_val,
        Err(r) => return Err(r)
    };
    
    // Try to parse the file into an Account
    match json::decode(&s) {
        Ok(decoded) => return Ok(decoded),
        Err(r) => return Err(String::from("Failed to parse config file ") 
                             + file_path
                             + ": " + r.to_string().as_ref())
    };
}
/// Read in a json file to an Account
Read in a json file to an Account
Read in a json file to an Account
pub fn read_account(file_path: &str) -> Result<Account, String>{
    // Try to read the file
    let s = match read_file(&file_path) {
        Ok(s_val) => s_val,
        Err(r) => return Err(r)
    };
    // Try to parse the file into an Account
    match json::decode(&s) {
        Ok(decoded) => return Ok(decoded),
        Err(r) => return Err(String::from("Failed to parse config file ") 
                             + file_path
                             + ": " + r.to_string().as_ref())
    };
}
pub fn read_account ( file_path : & str ) -> Result < Account , String > { // Try to read the file let s = match read_file ( & file_path ) { Ok ( s_val ) => s_val , Err ( r ) => return Err ( r ) } ; // Try to parse the file into an Account match json :: decode ( & s ) { Ok ( decoded ) => return Ok ( decoded ) , Err ( r ) => return Err ( String :: from ( " " ) + file_path + " " + r . to_string ( ) . as_ref ( ) ) } ; }
Read in a json file to an Account
Read in a json file to an Account
file_path
&str
file_path
&str