diff options
Diffstat (limited to 'src/statistics')
-rw-r--r-- | src/statistics/mod.rs | 6 | ||||
-rw-r--r-- | src/statistics/trackers.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/statistics/mod.rs b/src/statistics/mod.rs index f46f778..eccc3ee 100644 --- a/src/statistics/mod.rs +++ b/src/statistics/mod.rs @@ -20,7 +20,7 @@ pub type StatResult<T> = Result<T, StatError>; quick_error! { #[derive(Debug)] pub enum StatError { - TrackerError(err: Box<Error>) { + TrackerError(err: Box<dyn Error>) { description("tracker error") display("tracker returned an error: {}", err) cause(&**err) @@ -76,9 +76,9 @@ impl AgentStats { /// /// This method returns "nothing", as the statistics are saved in the trackers. /// It's the job of the caller to extract them appropriately. -pub fn run_trackers(log: &Log, trackers: &mut [&mut RunnableTracker]) -> StatResult<()> { +pub fn run_trackers(log: &Log, trackers: &mut [&mut dyn RunnableTracker]) -> StatResult<()> { for event in log.events() { - for mut tracker in trackers.iter_mut() { + for tracker in trackers.iter_mut() { try_tracker!((*tracker).run_feed(event)); } } diff --git a/src/statistics/trackers.rs b/src/statistics/trackers.rs index 98915d2..16cb755 100644 --- a/src/statistics/trackers.rs +++ b/src/statistics/trackers.rs @@ -64,12 +64,12 @@ pub trait Tracker { /// if you plan on getting any data. pub trait RunnableTracker { /// See `Tracker.feed()`. Renamed to avoid conflicts. - fn run_feed(&mut self, event: &Event) -> Result<(), Box<Error>>; + fn run_feed(&mut self, event: &Event) -> Result<(), Box<dyn Error>>; } impl<S, E: Error + 'static, T: Tracker<Stat = S, Error = E>> RunnableTracker for T { - fn run_feed(&mut self, event: &Event) -> Result<(), Box<Error>> { - self.feed(event).map_err(|e| Box::new(e) as Box<Error>) + fn run_feed(&mut self, event: &Event) -> Result<(), Box<dyn Error>> { + self.feed(event).map_err(|e| Box::new(e) as Box<dyn Error>) } } |