mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 13:50:05 -04:00
Generalize WindowBuilder::with_title
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user