fix clippy issues

This commit is contained in:
2024-12-11 09:11:30 +07:00
parent 516eb0e8bc
commit 10f042acab
49 changed files with 661 additions and 319 deletions

View File

@@ -41,7 +41,7 @@ impl DropdownItem for String {
}
fn value(&self) -> &Self::Value {
&self
self
}
}
@@ -53,7 +53,7 @@ impl DropdownItem for SharedString {
}
fn value(&self) -> &Self::Value {
&self
self
}
}
@@ -211,6 +211,8 @@ pub enum DropdownEvent<D: DropdownDelegate + 'static> {
Confirm(Option<<D::Item as DropdownItem>::Value>),
}
type Empty = Option<Box<dyn Fn(&WindowContext) -> AnyElement + 'static>>;
/// A Dropdown element.
pub struct Dropdown<D: DropdownDelegate + 'static> {
id: ElementId,
@@ -223,7 +225,7 @@ pub struct Dropdown<D: DropdownDelegate + 'static> {
placeholder: Option<SharedString>,
title_prefix: Option<SharedString>,
selected_value: Option<<D::Item as DropdownItem>::Value>,
empty: Option<Box<dyn Fn(&WindowContext) -> AnyElement + 'static>>,
empty: Empty,
width: Length,
menu_width: Length,
/// Store the bounds of the input