diff options
author | Daniel Schadt <kingdread@gmx.de> | 2020-04-04 13:33:45 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2020-04-04 13:54:10 +0200 |
commit | 9ebed9c42dd10bf7bef396a27edd2baa0619dd61 (patch) | |
tree | 7541884f56a873e14600df1ea2a43b57a462dd5f /src/statistics/mod.rs | |
parent | 9a1b5445679acc7034a3540e6b58b543941102a2 (diff) | |
download | evtclib-9ebed9c42dd10bf7bef396a27edd2baa0619dd61.tar.gz evtclib-9ebed9c42dd10bf7bef396a27edd2baa0619dd61.tar.bz2 evtclib-9ebed9c42dd10bf7bef396a27edd2baa0619dd61.zip |
Insert dyn for trait objects
This was a change in Rust a while back, so we're updating to the new,
non-deprecated syntax.
Diffstat (limited to 'src/statistics/mod.rs')
-rw-r--r-- | src/statistics/mod.rs | 6 |
1 files changed, 3 insertions, 3 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)); } } |