pub fn reps_total(&self, categories: &CategoryLookup) -> u32 {
        let mut total = 0;

        for (cat, reps) in self.reps_by_category.iter() {
            if let Some(category) = categories.find(cat) {
                total += ((*reps as f64) * category.weight) as u32;
            } else {
                // default to a weight of 1 (e.g. for categories that don't exist anymore)
                total += reps;
            }
        }

        total
    }
/// Calculate the weighted total of all repetitions in this day
Calculate the weighted total of all repetitions in this day
Calculate the weighted total of all repetitions in this day
pub fn reps_total(&self, categories: &CategoryLookup) -> u32 {
        let mut total = 0;
        for (cat, reps) in self.reps_by_category.iter() {
            if let Some(category) = categories.find(cat) {
                total += ((*reps as f64) * category.weight) as u32;
            } else {
                // default to a weight of 1 (e.g. for categories that don't exist anymore)
                total += reps;
            }
        }
        total
    }
pub fn reps_total ( & self , categories : & CategoryLookup ) -> u32 { let mut total = 0 ; for ( cat , reps ) in self . reps_by_category . iter ( ) { if let Some ( category ) = categories . find ( cat ) { total += ( ( * reps as f64 ) * category . weight ) as u32 ; } else { // default to a weight of 1 (e.g. for categories that don't exist anymore) total += reps ; } } total }
Calculate the weighted total of all repetitions in this day
Calculate the weighted total of all repetitions in this day
&self
categories
&CategoryLookup