/// Totally reset the state of the Account
Totally reset the state of the Account
Totally reset the state of the Account
pub fn reset (&mut self) {
        // Reset the state of everything
        self.balance = 0;
        // Now apply the payday transaction
        self.balance += self.payday.amount;
        self.last_reset = time::now().tm_mon;
        // Finally, apply each transaction in turn
        for transaction in &self.transactions {
            self.balance += transaction.amount;
        }
    }
pub fn reset ( & mut self ) { // Reset the state of everything self . balance = 0 ; // Now apply the payday transaction self . balance += self . payday . amount ; self . last_reset = time :: now ( ) . tm_mon ; // Finally, apply each transaction in turn for transaction in & self . transactions { self . balance += transaction . amount ; } }
Totally reset the state of the Account
Totally reset the state of the Account
&mut self