File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -408,7 +408,7 @@ unsafe impl Step for char {
408
408
let start = start as u32 ;
409
409
let end = end as u32 ;
410
410
if start <= end {
411
- let count = end - start + 1 ;
411
+ let count = end - start;
412
412
if start < 0xD800 && 0xE000 <= end {
413
413
usize:: try_from ( count - 0x800 ) . ok ( )
414
414
} else {
Original file line number Diff line number Diff line change @@ -1939,7 +1939,9 @@ fn test_char_range() {
1939
1939
assert ! ( ( '\0' ..=char :: MAX ) . rev( ) . eq( ( 0 ..=char :: MAX as u32 ) . filter_map( char :: from_u32) . rev( ) ) ) ;
1940
1940
1941
1941
assert_eq ! ( ( '\u{D7FF}' ..='\u{E000}' ) . count( ) , 2 ) ;
1942
+ assert_eq ! ( ( '\u{D7FF}' ..='\u{E000}' ) . size_hint( ) , ( 2 , Some ( 2 ) ) ) ;
1942
1943
assert_eq ! ( ( '\u{D7FF}' ..'\u{E000}' ) . count( ) , 1 ) ;
1944
+ assert_eq ! ( ( '\u{D7FF}' ..'\u{E000}' ) . size_hint( ) , ( 1 , Some ( 1 ) ) ) ;
1943
1945
}
1944
1946
1945
1947
#[ test]
You can’t perform that action at this time.
0 commit comments