// Apply Crit is the simplest operator; iterate through the rolls
// and mark all those that are above a thresold as "critical"
Apply Crit is the simplest operator; iterate through the rolls
and mark all those that are above a thresold as "critical"
Apply Crit is the simplest operator ; iterate through the rolls and mark all those that are above a thresold as " critical "
fn apply_crit(results: &mut Results, amt: i64) {
        let mut rolls: Vec<Roll> = Vec::new();
        for r in results.rolls.iter() {
            if amt < 0 {
                rolls.push(Roll{ crit: r.keep && r.roll > r.roll + amt, ..*r })
            } else {
                rolls.push(Roll{ crit: r.keep && r.roll >= amt, ..*r })
            }
        }
    }
fn apply_crit ( results : & mut Results , amt : i64 ) { let mut rolls : Vec < Roll > = Vec :: new ( ) ; for r in results . rolls . iter ( ) { if amt < 0 { rolls . push ( Roll { crit : r . keep && r . roll > r . roll + amt , .. * r } ) } else { rolls . push ( Roll { crit : r . keep && r . roll >= amt , .. * r } ) } } }
Apply Crit is the simplest operator; iterate through the rolls
and mark all those that are above a thresold as "critical"
Apply Crit is the simplest operator ; iterate through the rolls and mark all those that are above a thresold as " critical "
results
&mut Results
amt
i64