diff options
Diffstat (limited to 'src/win32')
-rw-r--r-- | src/win32/init.rs | 12 | ||||
-rw-r--r-- | src/win32/mod.rs | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/win32/init.rs b/src/win32/init.rs index d83c90f..41e87bb 100644 --- a/src/win32/init.rs +++ b/src/win32/init.rs @@ -40,8 +40,8 @@ pub fn new_window(builder: BuilderAttribs<'static>, builder_sharelists: Option<C { // initializing variables to be sent to the task - let title = OsStr::from_str(&builder.title).encode_wide().chain(Some(0).into_iter()) - .collect::<Vec<_>>(); + let title = OsStr::new(&builder.title).encode_wide().chain(Some(0).into_iter()) + .collect::<Vec<_>>(); let (tx, rx) = channel(); @@ -267,8 +267,8 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>, } unsafe fn register_window_class() -> Vec<u16> { - let class_name = OsStr::from_str("Window Class").encode_wide().chain(Some(0).into_iter()) - .collect::<Vec<_>>(); + let class_name = OsStr::new("Window Class").encode_wide().chain(Some(0).into_iter()) + .collect::<Vec<_>>(); let class = winapi::WNDCLASSEXW { cbSize: mem::size_of::<winapi::WNDCLASSEXW>() as winapi::UINT, @@ -530,8 +530,8 @@ unsafe fn set_pixel_format(hdc: &WindowWrapper, id: libc::c_int) -> Result<(), C } unsafe fn load_opengl32_dll() -> Result<winapi::HMODULE, CreationError> { - let name = OsStr::from_str("opengl32.dll").encode_wide().chain(Some(0).into_iter()) - .collect::<Vec<_>>(); + let name = OsStr::new("opengl32.dll").encode_wide().chain(Some(0).into_iter()) + .collect::<Vec<_>>(); let lib = kernel32::LoadLibraryW(name.as_ptr()); diff --git a/src/win32/mod.rs b/src/win32/mod.rs index be72d53..1f5f3c0 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -111,8 +111,8 @@ impl Window { /// /// Calls SetWindowText on the HWND. pub fn set_title(&self, text: &str) { - let text = OsStr::from_str(text).encode_wide().chain(Some(0).into_iter()) - .collect::<Vec<_>>(); + let text = OsStr::new(text).encode_wide().chain(Some(0).into_iter()) + .collect::<Vec<_>>(); unsafe { user32::SetWindowTextW(self.window.0, text.as_ptr() as winapi::LPCWSTR); |