File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 99
1010#![ allow( non_upper_case_globals) ]
1111
12+ use core_graphics_types:: base:: kCGErrorSuccess;
1213use libc;
1314use std:: ops:: Deref ;
1415use std:: ptr;
@@ -149,7 +150,7 @@ impl CGDisplay {
149150 let result = unsafe {
150151 CGGetDisplaysWithPoint ( point, 0 , ptr:: null_mut ( ) , & mut matching_display_count)
151152 } ;
152- if result == 0 {
153+ if result == kCGErrorSuccess {
153154 Ok ( matching_display_count)
154155 } else {
155156 Err ( result)
@@ -177,7 +178,7 @@ impl CGDisplay {
177178 )
178179 } ;
179180
180- if result == 0 {
181+ if result == kCGErrorSuccess {
181182 Ok ( ( displays, matching_display_count) )
182183 } else {
183184 Err ( result)
@@ -191,7 +192,7 @@ impl CGDisplay {
191192 let mut matching_display_count: u32 = 0 ;
192193 let result =
193194 unsafe { CGGetDisplaysWithRect ( rect, 0 , ptr:: null_mut ( ) , & mut matching_display_count) } ;
194- if result == 0 {
195+ if result == kCGErrorSuccess {
195196 Ok ( matching_display_count)
196197 } else {
197198 Err ( result)
@@ -218,7 +219,7 @@ impl CGDisplay {
218219 )
219220 } ;
220221
221- if result == 0 {
222+ if result == kCGErrorSuccess {
222223 Ok ( ( displays, matching_display_count) )
223224 } else {
224225 Err ( result)
You can’t perform that action at this time.
0 commit comments