Skip to content

Commit 8eeab73

Browse files
committed
Simplify constructors for CreateLabel
1 parent 743985e commit 8eeab73

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/builder/create_components.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -504,28 +504,22 @@ pub struct CreateLabel<'a> {
504504

505505
impl<'a> CreateLabel<'a> {
506506
/// Create a select menu with a specific label.
507-
pub fn select_menu(
508-
label: impl Into<Cow<'a, str>>,
509-
select_menu: impl Into<CreateSelectMenu<'a>>,
510-
) -> Self {
507+
pub fn select_menu(label: impl Into<Cow<'a, str>>, select_menu: CreateSelectMenu<'a>) -> Self {
511508
Self {
512509
kind: ComponentType::Label,
513510
label: label.into(),
514511
description: None,
515-
component: CreateLabelComponent::SelectMenu(select_menu.into()),
512+
component: CreateLabelComponent::SelectMenu(select_menu),
516513
}
517514
}
518515

519516
/// Create a text input with a specific label.
520-
pub fn input_text(
521-
label: impl Into<Cow<'a, str>>,
522-
input_text: impl Into<CreateInputText<'a>>,
523-
) -> Self {
517+
pub fn input_text(label: impl Into<Cow<'a, str>>, input_text: CreateInputText<'a>) -> Self {
524518
Self {
525519
kind: ComponentType::Label,
526520
label: label.into(),
527521
description: None,
528-
component: CreateLabelComponent::InputText(input_text.into()),
522+
component: CreateLabelComponent::InputText(input_text),
529523
}
530524
}
531525

0 commit comments

Comments
 (0)