I have the following problem:
pub struct Events { pub ts: u64, pub temperature_multiplier: (f64,f64), // (temperature,multiplier) } I have a VecDeque of this struct
elements_vec: VecDeque<Events> I would like to be able to go through all the elements of VecDeque and compute the the sum of (temperature * multiplier).
What I have tried:
elements_vec.iter().map(|(_, (t,m))| t * m ).sum() It returns an error saying "expected Struct Events".