diff options
author | Ivan Ukhov <ivan.ukhov@gmail.com> | 2016-05-08 09:28:42 +0200 |
---|---|---|
committer | Ivan Ukhov <ivan.ukhov@gmail.com> | 2016-05-08 09:28:42 +0200 |
commit | 54f442ea06e26654438c4f3acdbacca1b2b1cefe (patch) | |
tree | 0901b9ef9253037d539b5dac2e41c961b7c1368b | |
parent | 93c88ee54d365ce6804c1cab56ecc600e792263f (diff) | |
download | glutin-54f442ea06e26654438c4f3acdbacca1b2b1cefe.tar.gz glutin-54f442ea06e26654438c4f3acdbacca1b2b1cefe.zip |
Generalize WindowBuilder::with_title
-rw-r--r-- | examples/fullscreen.rs | 2 | ||||
-rw-r--r-- | src/window.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/fullscreen.rs b/examples/fullscreen.rs index 92d32a3..8671c9e 100644 --- a/examples/fullscreen.rs +++ b/examples/fullscreen.rs @@ -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(); diff --git a/src/window.rs b/src/window.rs index 8e82c1d..4cac1ce 100644 --- a/src/window.rs +++ b/src/window.rs @@ -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 } |