@@ -4,7 +4,7 @@ use std::convert::TryFrom;
4
4
use std:: io;
5
5
use std:: sync:: atomic:: { AtomicU64 , Ordering } ;
6
6
7
- use crossterm_winapi:: { is_true , Coord , Handle , HandleType , ScreenBuffer } ;
7
+ use crossterm_winapi:: { result , Coord , Handle , HandleType , ScreenBuffer } ;
8
8
use winapi:: {
9
9
shared:: minwindef:: { FALSE , TRUE } ,
10
10
um:: wincon:: { SetConsoleCursorInfo , SetConsoleCursorPosition , CONSOLE_CURSOR_INFO , COORD } ,
@@ -154,10 +154,12 @@ impl ScreenBufferCursor {
154
154
let position = COORD { X : x, Y : y } ;
155
155
156
156
unsafe {
157
- if ! is_true ( SetConsoleCursorPosition (
157
+ if result ( SetConsoleCursorPosition (
158
158
* * self . screen_buffer . handle ( ) ,
159
159
position,
160
- ) ) {
160
+ ) )
161
+ . is_err ( )
162
+ {
161
163
return Err ( io:: Error :: last_os_error ( ) ) ;
162
164
}
163
165
}
@@ -171,10 +173,12 @@ impl ScreenBufferCursor {
171
173
} ;
172
174
173
175
unsafe {
174
- if ! is_true ( SetConsoleCursorInfo (
176
+ if result ( SetConsoleCursorInfo (
175
177
* * self . screen_buffer . handle ( ) ,
176
178
& cursor_info,
177
- ) ) {
179
+ ) )
180
+ . is_err ( )
181
+ {
178
182
return Err ( io:: Error :: last_os_error ( ) ) ;
179
183
}
180
184
}
0 commit comments