fn counters_calculation(counters: &mut PatternCounters, options: &SearchOptions) {
    // do we need to save our thresholds ?
    if options.savethresholds {
        // critical errors
        if options.criticalthreshold != 0 {
            if counters.critical_count < options.criticalthreshold {
                // nothing to do
            } else {
                // or just the delta
                counters.critical_count -= options.criticalthreshold;
            }
        }
        // warning errors
        if options.warningthreshold != 0 {
            // warning errors
            if counters.warning_count < options.warningthreshold {
                // nothing to do
            } else {
                // or just the delta
                counters.warning_count -= options.warningthreshold;
            }
        }
    } else {
        // critical errors
        if options.criticalthreshold != 0 {
            if counters.critical_count < options.criticalthreshold {
                // no errors in this case
                counters.critical_count = 0;
            } else {
                // or just the delta
                counters.critical_count -= options.criticalthreshold;
            }
        }
        // warning errors
        if options.warningthreshold != 0 {
            // warning errors
            if counters.warning_count < options.warningthreshold {
                // no errors in this case
                counters.warning_count = 0;
            } else {
                // or just the delta
                counters.warning_count -= options.warningthreshold;
            }
        }
    }
}
// manage error counters depending on options
manage error counters depending on options
manage error counters depending on options
fn counters_calculation(counters: &mut PatternCounters, options: &SearchOptions) {
    // do we need to save our thresholds ?
    if options.savethresholds {
        // critical errors
        if options.criticalthreshold != 0 {
            if counters.critical_count < options.criticalthreshold {
                // nothing to do
            } else {
                // or just the delta
                counters.critical_count -= options.criticalthreshold;
            }
        }
        // warning errors
        if options.warningthreshold != 0 {
            // warning errors
            if counters.warning_count < options.warningthreshold {
                // nothing to do
            } else {
                // or just the delta
                counters.warning_count -= options.warningthreshold;
            }
        }
    } else {
        // critical errors
        if options.criticalthreshold != 0 {
            if counters.critical_count < options.criticalthreshold {
                // no errors in this case
                counters.critical_count = 0;
            } else {
                // or just the delta
                counters.critical_count -= options.criticalthreshold;
            }
        }
        // warning errors
        if options.warningthreshold != 0 {
            // warning errors
            if counters.warning_count < options.warningthreshold {
                // no errors in this case
                counters.warning_count = 0;
            } else {
                // or just the delta
                counters.warning_count -= options.warningthreshold;
            }
        }
    }
}
fn counters_calculation ( counters : & mut PatternCounters , options : & SearchOptions ) { // do we need to save our thresholds ? if options . savethresholds { // critical errors if options . criticalthreshold != 0 { if counters . critical_count < options . criticalthreshold { // nothing to do } else { // or just the delta counters . critical_count -= options . criticalthreshold ; } } // warning errors if options . warningthreshold != 0 { // warning errors if counters . warning_count < options . warningthreshold { // nothing to do } else { // or just the delta counters . warning_count -= options . warningthreshold ; } } } else { // critical errors if options . criticalthreshold != 0 { if counters . critical_count < options . criticalthreshold { // no errors in this case counters . critical_count = 0 ; } else { // or just the delta counters . critical_count -= options . criticalthreshold ; } } // warning errors if options . warningthreshold != 0 { // warning errors if counters . warning_count < options . warningthreshold { // no errors in this case counters . warning_count = 0 ; } else { // or just the delta counters . warning_count -= options . warningthreshold ; } } } }
manage error counters depending on options
manage error counters depending on options
counters
&mut PatternCounters
options
&SearchOptions
counters
&mut PatternCounters
options
&SearchOptions