Skip to content

Commit

Permalink
yewstack#1271 fix implementations to match function signature of trait
Browse files Browse the repository at this point in the history
  • Loading branch information
kellpossible committed May 30, 2020
1 parent ae4830b commit ab331e5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions yewtil/src/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ pub trait LinkFuture {
impl<COMP: Component> LinkFuture for ComponentLink<COMP> {
type Message = COMP::Message;

fn callback_future<F, FU, IN, M>(&self, function: F) -> yew::Callback<IN>
fn callback_future<FN, FU, IN, M>(&self, function: F) -> yew::Callback<IN>
where
M: Into<Self::Message>,
FU: Future<Output = M> + 'static,
F: Fn(IN) -> FU + 'static {
FN: Fn(IN) -> FU + 'static,
{
let link = self.clone();

let closure = move |input: IN| {
Expand Down Expand Up @@ -87,11 +88,12 @@ impl<COMP: Component> LinkFuture for ComponentLink<COMP> {
impl<AGN: Agent> LinkFuture for AgentLink<AGN> {
type Message = AGN::Message;

fn callback_future<F, FU, IN, M>(&self, function: F) -> yew::Callback<IN>
fn callback_future<FN, FU, IN, M>(&self, function: F) -> yew::Callback<IN>
where
M: Into<Self::Message>,
FU: Future<Output = M> + 'static,
F: Fn(IN) -> FU + 'static {
FN: Fn(IN) -> FU + 'static,
{
let link = self.clone();

let closure = move |input: IN| {
Expand Down

0 comments on commit ab331e5

Please sign in to comment.