summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-07-23 04:06:26 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-07-23 04:06:26 +0200
commita225a218e010debb4bd32af09593b8929652b60f (patch)
tree7fec1fc0f954a6ef202b5bcfd607579aab6a742e /native
parentaaf598612338aacc2c73a27cceb26b239f2e3b70 (diff)
downloadiced-a225a218e010debb4bd32af09593b8929652b60f.tar.gz
iced-a225a218e010debb4bd32af09593b8929652b60f.tar.bz2
iced-a225a218e010debb4bd32af09593b8929652b60f.zip
Fix `Default` implementation for `pick_list::State`
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/pick_list.rs13
1 files changed, 12 insertions, 1 deletions
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<T> {
menu: menu::State,
is_open: bool,
@@ -38,6 +38,17 @@ pub struct State<T> {
last_selection: Option<T>,
}
+impl<T> Default for State<T> {
+ 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