pub fn execute_transaction(t: &Transaction, tx_log: &mut TransactionLog, client: &mut Client) {
    let tx_exists = tx_log.contains(t.id);
    let record_op = match t.r#type {
        Deposit if !tx_exists => deposit(client, t.amount),
        Withdrawal if !tx_exists => withdraw(client, t.amount),
        Dispute => dispute(client, t.id, tx_log),
        Resolve => resolve(client, t.id, tx_log),
        Chargeback => chargeback(client, t.id, tx_log),
        _ => false,
    };
    if record_op {
        tx_log.push(t);
    }
}
/// Run the correct logic for the type of transaction.
/// If the transaction was valid and successful, it gets added to the TransactionLog
Run the correct logic for the type of transaction.
If the transaction was valid and successful, it gets added to the TransactionLog
Run the correct logic for the type of transaction . If the transaction was valid and successful it gets added to the TransactionLog
pub fn execute_transaction(t: &Transaction, tx_log: &mut TransactionLog, client: &mut Client) {
    let tx_exists = tx_log.contains(t.id);
    let record_op = match t.r#type {
        Deposit if !tx_exists => deposit(client, t.amount),
        Withdrawal if !tx_exists => withdraw(client, t.amount),
        Dispute => dispute(client, t.id, tx_log),
        Resolve => resolve(client, t.id, tx_log),
        Chargeback => chargeback(client, t.id, tx_log),
        _ => false,
    };
    if record_op {
        tx_log.push(t);
    }
}
pub fn execute_transaction ( t : & Transaction , tx_log : & mut TransactionLog , client : & mut Client ) { let tx_exists = tx_log . contains ( t . id ) ; let record_op = match t . r#type { Deposit if ! tx_exists => deposit ( client , t . amount ) , Withdrawal if ! tx_exists => withdraw ( client , t . amount ) , Dispute => dispute ( client , t . id , tx_log ) , Resolve => resolve ( client , t . id , tx_log ) , Chargeback => chargeback ( client , t . id , tx_log ) , _ => false , } ; if record_op { tx_log . push ( t ) ; } }
Run the correct logic for the type of transaction.
Run the correct logic for the type of transaction .
t
&Transaction
tx_log
&mut TransactionLog
client
&mut Client
t
&Transaction
tx_log
&mut TransactionLog
client
&mut Client