fn calc_avg_in_pos(&mut self, journal: Journal) {
        let mut temp: Vec<usize> = Vec::new();
        let mut counter: usize = 0;
        let mut temp_sig = journal.get_signals().first().unwrap().to_owned();
        println!("{:?}", &journal.get_signals());
        for sig in journal.get_signals() {
            if sig == Signal::Sleep || sig == temp_sig {
                counter += 1;
            } else {
                temp_sig = sig;
                temp.push(counter);
                counter = 1;
            }
            //println!("counter:{:?}\ntemps:{:?}", &counter, &temp);
        }

        self.avg_in_pos = temp.iter().sum::<usize>() as f64 / temp.len() as f64;
    }
//something's wrong I can feel it or more like I see it spews BS
something's wrong I can feel it or more like I see it spews BS
something ' s wrong I can feel it or more like I see it spews BS
fn calc_avg_in_pos(&mut self, journal: Journal) {
        let mut temp: Vec<usize> = Vec::new();
        let mut counter: usize = 0;
        let mut temp_sig = journal.get_signals().first().unwrap().to_owned();
        println!("{:?}", &journal.get_signals());
        for sig in journal.get_signals() {
            if sig == Signal::Sleep || sig == temp_sig {
                counter += 1;
            } else {
                temp_sig = sig;
                temp.push(counter);
                counter = 1;
            }
            //println!("counter:{:?}\ntemps:{:?}", &counter, &temp);
        }
        self.avg_in_pos = temp.iter().sum::<usize>() as f64 / temp.len() as f64;
    }
fn calc_avg_in_pos ( & mut self , journal : Journal ) { let mut temp : Vec < usize > = Vec :: new ( ) ; let mut counter : usize = 0 ; let mut temp_sig = journal . get_signals ( ) . first ( ) . unwrap ( ) . to_owned ( ) ; println ! ( " " journal get_signals ( ) ) ; for sig in journal . get_signals ( ) { if sig == Signal :: Sleep || sig == temp_sig { counter += 1 ; } else { temp_sig = sig ; temp . push ( counter ) ; counter = 1 ; } //println!("counter:{:?}\ntemps:{:?}", &counter, &temp); } self . avg_in_pos = temp . iter ( ) . sum :: < usize > ( ) as f64 / temp . len ( ) as f64 ; }
something's wrong I can feel it or more like I see it spews BS
something ' s wrong I can feel it or more like I see it spews BS
&mut self
journal
Journal
&mut self
journal
Journal