Skip to content

Commit

Permalink
Replace show_index String with Into<TextWidget> (emilk#2790)
Browse files Browse the repository at this point in the history
  • Loading branch information
tosti007 authored Mar 29, 2023
1 parent 977749b commit 5ccc714
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/egui/src/containers/combo_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@ impl ComboBox {
/// ui,
/// &mut selected,
/// alternatives.len(),
/// |i| alternatives[i].to_owned()
/// |i| alternatives[i]
/// );
/// # });
/// ```
pub fn show_index(
pub fn show_index<Text: Into<WidgetText>>(
self,
ui: &mut Ui,
selected: &mut usize,
len: usize,
get: impl Fn(usize) -> String,
get: impl Fn(usize) -> Text,
) -> Response {
let slf = self.selected_text(get(*selected));

Expand Down

0 comments on commit 5ccc714

Please sign in to comment.