Skip to content

Commit

Permalink
fix(ui/single_select): Added a Default implementation for SelectForm …
Browse files Browse the repository at this point in the history
…using SelectFormBuilder

Added a Default implementation for SelectForm using SelectFormBuilder.
This change ensures that SelectForm can be instantiated with default
values, improving usability and consistency.
  • Loading branch information
sarub0b0 committed Oct 20, 2024
1 parent 5428277 commit ab84a12
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ui/widget/single_select/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl Default for SelectFormBuilder {
}

#[derive(Derivative)]
#[derivative(Debug, Default)]
#[derivative(Debug)]
pub struct SelectForm<'a> {
list_items: BTreeSet<LiteralItem>,
list_widget: List<'a>,
Expand All @@ -87,6 +87,12 @@ pub struct SelectForm<'a> {
matcher: SkimMatcherV2,
}

impl Default for SelectForm<'_> {
fn default() -> Self {
SelectFormBuilder::default().build()
}
}

impl<'a> SelectForm<'a> {
pub fn builder() -> SelectFormBuilder {
SelectFormBuilder::default()
Expand Down

0 comments on commit ab84a12

Please sign in to comment.