Skip to content

Commit

Permalink
Removed std::fmt::Display requirement for TextBuffer.
Browse files Browse the repository at this point in the history
Now uses the `AsRef<str>` impl to format it where applicable.
  • Loading branch information
Zenithsiz committed Jun 4, 2021
1 parent 344bcc7 commit a2937d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions egui/src/widgets/text_edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl CCursorPair {
/// an underlying buffer.
///
/// Most likely you will use a `String` which implements `TextBuffer`.
pub trait TextBuffer: AsRef<str> + Into<String> + std::fmt::Display {
pub trait TextBuffer: AsRef<str> + Into<String> {
/// Inserts text `text` into this buffer at character index `ch_idx`.
///
/// # Notes
Expand Down Expand Up @@ -740,7 +740,7 @@ impl<'t, S: TextBuffer> TextEdit<'t, S> {

ui.memory().id_data.insert(id, state);

response.widget_info(|| WidgetInfo::text_edit(&*text));
response.widget_info(|| WidgetInfo::text_edit(text.as_ref()));
response
}
}
Expand Down

0 comments on commit a2937d8

Please sign in to comment.