From f545ffd37ea8b3db5b17f4c633822625671e2899 Mon Sep 17 00:00:00 2001 From: orzogc Date: Sun, 5 Jun 2022 21:04:24 +0800 Subject: [PATCH] `Callback::reform()` should return `Callback` --- packages/yew/src/callback.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/yew/src/callback.rs b/packages/yew/src/callback.rs index 613457f7028..84aff3ab3e3 100644 --- a/packages/yew/src/callback.rs +++ b/packages/yew/src/callback.rs @@ -69,14 +69,14 @@ impl Default for Callback { impl Callback { /// Creates a new callback from another callback and a function /// That when emited will call that function and will emit the original callback - pub fn reform(&self, func: F) -> Callback + pub fn reform(&self, func: F) -> Callback where F: Fn(T) -> IN + 'static, { let this = self.clone(); let func = move |input| { let output = func(input); - this.emit(output); + this.emit(output) }; Callback::from(func) }