diff options
author | 2021-07-19 21:18:54 +0700 | |
---|---|---|
committer | 2021-07-19 21:18:54 +0700 | |
commit | b97954a1ee3ec7bc85d1d41b397e994752ff1831 (patch) | |
tree | 0adfbc12d44161fad183269b5d724042f5fe09af /core | |
parent | c8ac77e4e99414746adedf38cf69ac8dcd1601a4 (diff) | |
download | iced-b97954a1ee3ec7bc85d1d41b397e994752ff1831.tar.gz iced-b97954a1ee3ec7bc85d1d41b397e994752ff1831.tar.bz2 iced-b97954a1ee3ec7bc85d1d41b397e994752ff1831.zip |
Add a presets `Menu` to the `game_of_life` example
Diffstat (limited to 'core')
-rw-r--r-- | core/src/menu.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<Message> Menu<Message> { /// /// This is useful to compose menus and split them into different /// abstraction levels. - pub fn map<B>(self, f: &impl Fn(Message) -> B) -> Menu<B> { + pub fn map<B>(self, f: impl Fn(Message) -> B + Copy) -> Menu<B> { // TODO: Use a boxed trait to avoid reallocation of entries Menu { entries: self @@ -100,7 +100,7 @@ impl<Message> Entry<Message> { Self::Dropdown { title, submenu } } - fn map<B>(self, f: &impl Fn(Message) -> B) -> Entry<B> { + fn map<B>(self, f: impl Fn(Message) -> B + Copy) -> Entry<B> { match self { Self::Item { title, |