Skip to content

Commit

Permalink
Use trait objects with explicit dyn in examples (#687)
Browse files Browse the repository at this point in the history
Fixes #685

Address deprecations warnings in the examples directory:

warning: trait objects without an explicit `dyn` are deprecated
  • Loading branch information
benreyn authored and jstarry committed Oct 8, 2019
1 parent c24ee3e commit 01c0dd0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/game_of_life/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct Model {
cellules_width: usize,
cellules_height: usize,
#[allow(unused)]
job: Box<Task>,
job: Box<dyn Task>,
}

impl Cellule {
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_thread/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub enum Msg {
pub struct Worker {
link: AgentLink<Worker>,
interval: IntervalService,
task: Box<Task>,
task: Box<dyn Task>,
fetch: FetchService,
}

Expand Down
2 changes: 1 addition & 1 deletion examples/multi_thread/src/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub enum Msg {
pub struct Worker {
link: AgentLink<Worker>,
interval: IntervalService,
task: Box<Task>,
task: Box<dyn Task>,
fetch: FetchService,
}

Expand Down
8 changes: 4 additions & 4 deletions examples/multi_thread/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use yew::worker::*;
use yew::{html, Component, ComponentLink, Html, ShouldRender};

pub struct Model {
worker: Box<Bridge<native_worker::Worker>>,
job: Box<Bridge<job::Worker>>,
context: Box<Bridge<context::Worker>>,
context_2: Box<Bridge<context::Worker>>,
worker: Box<dyn Bridge<native_worker::Worker>>,
job: Box<dyn Bridge<job::Worker>>,
context: Box<dyn Bridge<context::Worker>>,
context_2: Box<dyn Bridge<context::Worker>>,
}

pub enum Msg {
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_thread/src/native_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub enum Msg {
pub struct Worker {
link: AgentLink<Worker>,
interval: IntervalService,
task: Box<Task>,
task: Box<dyn Task>,
fetch: FetchService,
}

Expand Down
4 changes: 2 additions & 2 deletions examples/timer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ pub struct Model {
console: ConsoleService,
callback_tick: Callback<()>,
callback_done: Callback<()>,
job: Option<Box<Task>>,
job: Option<Box<dyn Task>>,
messages: Vec<&'static str>,
_standalone: Box<Task>,
_standalone: Box<dyn Task>,
}

pub enum Msg {
Expand Down

0 comments on commit 01c0dd0

Please sign in to comment.