From b97954a1ee3ec7bc85d1d41b397e994752ff1831 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 19 Jul 2021 21:18:54 +0700 Subject: Add a presets `Menu` to the `game_of_life` example --- core/src/menu.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/src/menu.rs b/core/src/menu.rs index 3ad7b7a2..8a679085 100644 --- a/core/src/menu.rs +++ b/core/src/menu.rs @@ -41,7 +41,7 @@ impl Menu { /// /// This is useful to compose menus and split them into different /// abstraction levels. - pub fn map(self, f: &impl Fn(Message) -> B) -> Menu { + pub fn map(self, f: impl Fn(Message) -> B + Copy) -> Menu { // TODO: Use a boxed trait to avoid reallocation of entries Menu { entries: self @@ -100,7 +100,7 @@ impl Entry { Self::Dropdown { title, submenu } } - fn map(self, f: &impl Fn(Message) -> B) -> Entry { + fn map(self, f: impl Fn(Message) -> B + Copy) -> Entry { match self { Self::Item { title, -- cgit