pub fn do_setup(config_file_path: &str, payday_amount: i64, payday_day: u8) 
    -> Result<(), String>
{
    // We're setting up a new config file
    // First, create the payday transaction
    let payday = Transaction {
        amount: payday_amount,
        recur_day: Some(payday_day),
    };
    // Create the new account
    let empty_acc = Account::new(payday, 0);
    match write_account(&config_file_path, &empty_acc){
        Ok(_) => return Ok(()),
        Err(s) => return Err(s),
    };
}
/// Sets up the initial config file with an initial transaction
Sets up the initial config file with an initial transaction
Sets up the initial config file with an initial transaction
pub fn do_setup(config_file_path: &str, payday_amount: i64, payday_day: u8) 
    -> Result<(), String>
{
    // We're setting up a new config file
    // First, create the payday transaction
    let payday = Transaction {
        amount: payday_amount,
        recur_day: Some(payday_day),
    };
    // Create the new account
    let empty_acc = Account::new(payday, 0);
    match write_account(&config_file_path, &empty_acc){
        Ok(_) => return Ok(()),
        Err(s) => return Err(s),
    };
}
pub fn do_setup ( config_file_path : & str , payday_amount : i64 , payday_day : u8 ) -> Result < ( ) , String > { // We're setting up a new config file // First, create the payday transaction let payday = Transaction { amount : payday_amount , recur_day : Some ( payday_day ) , } ; // Create the new account let empty_acc = Account :: new ( payday , 0 ) ; match write_account ( & config_file_path , & empty_acc ) { Ok ( _ ) => return Ok ( ( ) ) , Err ( s ) => return Err ( s ) , } ; }
Sets up the initial config file with an initial transaction
Sets up the initial config file with an initial transaction
config_file_path
&str
payday_amount
i64
payday_day
u8
config_file_path
&str
payday_amount
i64
payday_day
u8