Merge pull request #773 from IvanUkhov/title

Generalize WindowBuilder::with_title
This commit is contained in:
tomaka 2016-05-08 11:13:58 +02:00
commit 547161af27
2 changed files with 3 additions and 3 deletions

View file

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

View file

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