Generalize WindowBuilder::with_title

This commit is contained in:
Ivan Ukhov 2016-05-08 09:28:42 +02:00
parent 93c88ee54d
commit 54f442ea06
2 changed files with 3 additions and 3 deletions

View file

@ -32,7 +32,7 @@ fn main() {
};
let window = glutin::WindowBuilder::new()
.with_title("Hello world!".to_string())
.with_title("Hello world!")
.with_fullscreen(monitor)
.build()
.unwrap();

View file

@ -63,8 +63,8 @@ impl<'a> WindowBuilder<'a> {
/// Requests a specific title for the window.
#[inline]
pub fn with_title(mut self, title: String) -> WindowBuilder<'a> {
self.window.title = title;
pub fn with_title<T: Into<String>>(mut self, title: T) -> WindowBuilder<'a> {
self.window.title = title.into();
self
}