Skip to content

Commit

Permalink
Fixed syntax error on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonwieloch committed Sep 6, 2017
1 parent 8c6b53e commit 3472290
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/raw/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ pub unsafe fn get_sym(handle: Handle, name: &CStr) -> Result<*mut (), Error> {
#[inline]
pub unsafe fn open_lib(name: &OsStr) -> Result<Handle, Error> {
let wide_name: Vec<u16> = name.encode_wide().chain(Some(0)).collect();
let _guard = ErrorModeGuard::new()?;
let _guard = match ErrorModeGuard::new() {
Ok(val) => val,
Err(err) => return Error::OpeningLibraryError(err),
};
let handle = kernel32::LoadLibraryW(wide_name.as_ptr());
if handle.is_null() {
Err(Error::OpeningLibraryError(get_win_error()))
Expand Down

0 comments on commit 3472290

Please sign in to comment.