File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments