comparison rust/src/types.rs @ 621:8136a6b99866 rust

make it compile again
author Matt Johnston <matt@ucc.asn.au>
date Sat, 15 Apr 2017 23:39:23 +0800
parents 87a78343140e
children 03167105f6de
comparison
equal deleted inserted replaced
620:8fda564cc46f 621:8136a6b99866
236 pub fn set_limit(&mut self, limit: Duration) { 236 pub fn set_limit(&mut self, limit: Duration) {
237 self.limit = limit; 237 self.limit = limit;
238 self.trim(); 238 self.trim();
239 } 239 }
240 240
241 fn integrate(&self) -> Duration { 241 pub fn integrate(&self) -> Duration {
242 let durs = self.on_periods.iter().map(|p| { 242 let durs = self.on_periods.iter().map(|p| {
243 let end = p.end.unwrap_or_else(|| Instant::now()); 243 let end = p.end.unwrap_or_else(|| Instant::now());
244 end - p.start 244 end - p.start
245 }); 245 });
246 durs.sum() 246 durs.sum()