Replace show_index String with Into<TextWidget> (#2790)

This commit is contained in:
Brian Janssen 2023-03-29 17:00:31 +02:00 committed by GitHub
parent 977749b0e0
commit 5ccc71415e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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));