From a225a218e010debb4bd32af09593b8929652b60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 23 Jul 2020 04:06:26 +0200 Subject: [PATCH] Fix `Default` implementation for `pick_list::State` --- native/src/widget/pick_list.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/native/src/widget/pick_list.rs b/native/src/widget/pick_list.rs index b5e3c99c..3e83fa56 100644 --- a/native/src/widget/pick_list.rs +++ b/native/src/widget/pick_list.rs @@ -30,7 +30,7 @@ where /// The local state of a [`PickList`]. /// /// [`PickList`]: struct.PickList.html -#[derive(Debug, Clone, Default)] +#[derive(Debug, Clone)] pub struct State { menu: menu::State, is_open: bool, @@ -38,6 +38,17 @@ pub struct State { last_selection: Option, } +impl Default for State { + fn default() -> Self { + Self { + menu: menu::State::default(), + is_open: bool::default(), + hovered_option: Option::default(), + last_selection: Option::default(), + } + } +} + impl<'a, T: 'a, Message, Renderer: self::Renderer> PickList<'a, T, Message, Renderer> where