Skip to content

Commit b45ad77

Browse files
authored
fix window v0.58.0 build error (#585)
1 parent b52f2cb commit b45ad77

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

spotify_player/src/media_control.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ mod windows {
162162
pub fn new() -> Result<DummyWindow, String> {
163163
let class_name = w!("SimpleTray");
164164

165-
let handle_result = unsafe {
165+
unsafe {
166166
let instance = GetModuleHandleW(None)
167167
.map_err(|e| (format!("Getting module handle failed: {e}")))?;
168168

@@ -194,19 +194,18 @@ mod windows {
194194
None,
195195
instance,
196196
None,
197-
);
197+
)
198+
.map_err(|e| (format!("Failed to create window: {e}")))?;
198199

199-
if handle.0 == 0 {
200+
if handle.0.is_null() {
200201
Err(format!(
201202
"Message only window creation failed: {}",
202203
Error::last_os_error()
203204
))
204205
} else {
205-
Ok(handle)
206+
Ok(DummyWindow { handle })
206207
}
207-
};
208-
209-
handle_result.map(|handle| DummyWindow { handle })
208+
}
210209
}
211210
extern "system" fn wnd_proc(
212211
hwnd: HWND,

0 commit comments

Comments
 (0)