@@ -49,7 +49,7 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
49
49
unsafe {
50
50
let hwnd = FindWindowW ( class_name. as_ptr ( ) , window_name. as_ptr ( ) ) ;
51
51
52
- if hwnd != 0 {
52
+ if !hwnd . is_null ( ) {
53
53
let data = format ! (
54
54
"{}|{}\0 " ,
55
55
std:: env:: current_dir( )
@@ -69,7 +69,7 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
69
69
}
70
70
}
71
71
} else {
72
- app. manage ( MutexHandle ( hmutex) ) ;
72
+ app. manage ( MutexHandle ( hmutex as _ ) ) ;
73
73
74
74
let hwnd = create_event_target_window :: < R > ( & class_name, & window_name) ;
75
75
unsafe {
@@ -80,7 +80,7 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
80
80
)
81
81
} ;
82
82
83
- app. manage ( TargetWindowHandle ( hwnd) ) ;
83
+ app. manage ( TargetWindowHandle ( hwnd as _ ) ) ;
84
84
}
85
85
86
86
Ok ( ( ) )
@@ -96,12 +96,12 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
96
96
pub fn destroy < R : Runtime , M : Manager < R > > ( manager : & M ) {
97
97
if let Some ( hmutex) = manager. try_state :: < MutexHandle > ( ) {
98
98
unsafe {
99
- ReleaseMutex ( hmutex. 0 ) ;
100
- CloseHandle ( hmutex. 0 ) ;
99
+ ReleaseMutex ( hmutex. 0 as _ ) ;
100
+ CloseHandle ( hmutex. 0 as _ ) ;
101
101
}
102
102
}
103
103
if let Some ( hwnd) = manager. try_state :: < TargetWindowHandle > ( ) {
104
- unsafe { DestroyWindow ( hwnd. 0 ) } ;
104
+ unsafe { DestroyWindow ( hwnd. 0 as _ ) } ;
105
105
}
106
106
}
107
107
@@ -145,12 +145,12 @@ fn create_event_target_window<R: Runtime>(class_name: &[u16], window_name: &[u16
145
145
cbClsExtra : 0 ,
146
146
cbWndExtra : 0 ,
147
147
hInstance : GetModuleHandleW ( std:: ptr:: null ( ) ) ,
148
- hIcon : 0 ,
149
- hCursor : 0 ,
150
- hbrBackground : 0 ,
148
+ hIcon : std :: ptr :: null_mut ( ) ,
149
+ hCursor : std :: ptr :: null_mut ( ) ,
150
+ hbrBackground : std :: ptr :: null_mut ( ) ,
151
151
lpszMenuName : std:: ptr:: null ( ) ,
152
152
lpszClassName : class_name. as_ptr ( ) ,
153
- hIconSm : 0 ,
153
+ hIconSm : std :: ptr :: null_mut ( ) ,
154
154
} ;
155
155
156
156
RegisterClassExW ( & class) ;
@@ -174,8 +174,8 @@ fn create_event_target_window<R: Runtime>(class_name: &[u16], window_name: &[u16
174
174
0 ,
175
175
0 ,
176
176
0 ,
177
- 0 ,
178
- 0 ,
177
+ std :: ptr :: null_mut ( ) ,
178
+ std :: ptr :: null_mut ( ) ,
179
179
GetModuleHandleW ( std:: ptr:: null ( ) ) ,
180
180
std:: ptr:: null ( ) ,
181
181
) ;
0 commit comments