diff --git a/src/window_draw_list.rs b/src/window_draw_list.rs index 3a34f80..4790b5f 100644 --- a/src/window_draw_list.rs +++ b/src/window_draw_list.rs @@ -210,11 +210,13 @@ impl<'ui> WindowDrawList<'ui> { } /// Draw a text whose upper-left corner is at point `pos`. - pub fn add_text(&self, pos: P, col: C, text: &str) + pub fn add_text(&self, pos: P, col: C, text: T) where P: Into, C: Into, + T: AsRef, { + let text = text.as_ref(); unsafe { let start = text.as_ptr() as *const i8; let end = (start as usize + text.len()) as *const i8;