Simplify on_toggle_maybe for Checkbox

This commit is contained in:
Héctor Ramón Jiménez 2024-02-01 13:21:01 +01:00
parent 4afe1c7111
commit faeb4536b3
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -116,8 +116,7 @@ where
where
F: Fn(bool) -> Message + 'a,
{
self.on_toggle =
f.map(|f| Box::new(f) as Box<dyn Fn(bool) -> Message + 'a>);
self.on_toggle = f.map(|f| Box::new(f) as _);
self
}