diff --git a/egui/src/containers/collapsing_header.rs b/egui/src/containers/collapsing_header.rs index c05ef57a..b7bdc8f5 100644 --- a/egui/src/containers/collapsing_header.rs +++ b/egui/src/containers/collapsing_header.rs @@ -148,7 +148,7 @@ impl CollapsingHeader { /// If the label is unique and static this is fine, /// but if it changes or there are several `CollapsingHeader` with the same title /// you need to provide a unique id source with [`Self::id_source`]. - pub fn new(label: impl Into) -> Self { + pub fn new(label: impl ToString) -> Self { let label = Label::new(label).text_style(TextStyle::Button).wrap(false); let id_source = Id::new(label.text()); Self { diff --git a/egui/src/containers/combo_box.rs b/egui/src/containers/combo_box.rs index 4622a119..8f19ffcf 100644 --- a/egui/src/containers/combo_box.rs +++ b/egui/src/containers/combo_box.rs @@ -55,8 +55,9 @@ impl ComboBox { } /// What we show as the currently selected value - pub fn selected_text(mut self, selected_text: impl Into) -> Self { - self.selected_text = selected_text.into(); + #[allow(clippy::needless_pass_by_value)] + pub fn selected_text(mut self, selected_text: impl ToString) -> Self { + self.selected_text = selected_text.to_string(); self } @@ -150,7 +151,7 @@ impl ComboBox { pub fn combo_box_with_label( ui: &mut Ui, label: impl Into