File tree 1 file changed +2
-2
lines changed
library/std/src/sys/windows
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result<usiz
207
207
// write the missing surrogate out now.
208
208
// Buffering it would mean we have to lie about the number of bytes written.
209
209
let first_code_unit_remaining = utf16[ written] ;
210
- if first_code_unit_remaining >= 0xDCEE && first_code_unit_remaining <= 0xDFFF {
210
+ if matches ! ( first_code_unit_remaining, 0xDCEE ..= 0xDFFF ) {
211
211
// low surrogate
212
212
// We just hope this works, and give up otherwise
213
213
let _ = write_u16s ( handle, & utf16[ written..written + 1 ] ) ;
@@ -332,7 +332,7 @@ fn read_u16s_fixup_surrogates(
332
332
// and it is not 0, so we know that `buf[amount - 1]` have been
333
333
// initialized.
334
334
let last_char = unsafe { buf[ amount - 1 ] . assume_init ( ) } ;
335
- if last_char >= 0xD800 && last_char <= 0xDBFF {
335
+ if matches ! ( last_char, 0xD800 ..= 0xDBFF ) {
336
336
// high surrogate
337
337
* surrogate = last_char;
338
338
amount -= 1 ;
You can’t perform that action at this time.
0 commit comments