@@ -46,38 +46,42 @@ pub trait BasicTheme: Sized {
4646 styled_label :: < Self , Self :: LabelStyle , _ > ( label)
4747 }
4848
49- fn primary_button ( label : & ' static str ) -> StyledButton < Self :: PixelColor > {
50- styled_button :: < Self , Self :: PrimaryButton > ( label)
49+ fn primary_button < S : AsRef < str > > ( label : S ) -> StyledButton < S , Self :: PixelColor > {
50+ styled_button :: < _ , Self , Self :: PrimaryButton > ( label)
5151 }
5252
53- fn secondary_button ( label : & ' static str ) -> StyledButton < Self :: PixelColor > {
54- styled_button :: < Self , Self :: SecondaryButton > ( label)
53+ fn secondary_button < S : AsRef < str > > ( label : S ) -> StyledButton < S , Self :: PixelColor > {
54+ styled_button :: < _ , Self , Self :: SecondaryButton > ( label)
5555 }
5656
57- fn primary_button_stretched ( label : & ' static str ) -> StyledButtonStretched < Self :: PixelColor > {
58- styled_button_stretched :: < Self , Self :: PrimaryButton > ( label)
57+ fn primary_button_stretched < S : AsRef < str > > (
58+ label : S ,
59+ ) -> StyledButtonStretched < S , Self :: PixelColor > {
60+ styled_button_stretched :: < _ , Self , Self :: PrimaryButton > ( label)
5961 }
6062
61- fn secondary_button_stretched ( label : & ' static str ) -> StyledButtonStretched < Self :: PixelColor > {
62- styled_button_stretched :: < Self , Self :: SecondaryButton > ( label)
63+ fn secondary_button_stretched < S : AsRef < str > > (
64+ label : S ,
65+ ) -> StyledButtonStretched < S , Self :: PixelColor > {
66+ styled_button_stretched :: < _ , Self , Self :: SecondaryButton > ( label)
6367 }
6468
65- fn toggle_button ( label : & ' static str ) -> StyledToggleButton < Self :: PixelColor > {
66- styled_toggle_button :: < Self , Self :: ToggleButton > ( label)
69+ fn toggle_button < S : AsRef < str > > ( label : S ) -> StyledToggleButton < S , Self :: PixelColor > {
70+ styled_toggle_button :: < _ , Self , Self :: ToggleButton > ( label)
6771 }
6872
69- fn toggle_button_stretched (
70- label : & ' static str ,
71- ) -> StyledToggleButtonStretched < Self :: PixelColor > {
72- styled_toggle_button_stretched :: < Self , Self :: ToggleButton > ( label)
73+ fn toggle_button_stretched < S : AsRef < str > > (
74+ label : S ,
75+ ) -> StyledToggleButtonStretched < S , Self :: PixelColor > {
76+ styled_toggle_button_stretched :: < _ , Self , Self :: ToggleButton > ( label)
7377 }
7478
75- fn check_box ( label : & ' static str ) -> StyledCheckBox < Self :: PixelColor > {
76- styled_check_box :: < Self , Self :: CheckBox > ( label)
79+ fn check_box < S : AsRef < str > > ( label : S ) -> StyledCheckBox < S , Self :: PixelColor > {
80+ styled_check_box :: < _ , Self , Self :: CheckBox > ( label)
7781 }
7882
79- fn radio_button ( label : & ' static str ) -> StyledRadioButton < Self :: PixelColor > {
80- styled_radio_button :: < Self , Self :: RadioButton > ( label)
83+ fn radio_button < S : AsRef < str > > ( label : S ) -> StyledRadioButton < S , Self :: PixelColor > {
84+ styled_radio_button :: < _ , Self , Self :: RadioButton > ( label)
8185 }
8286
8387 fn horizontal_scrollbar (
0 commit comments