File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 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 {
408408 let start = start as u32 ;
409409 let end = end as u32 ;
410410 if start <= end {
411- let count = end - start + 1 ;
411+ let count = end - start;
412412 if start < 0xD800 && 0xE000 <= end {
413413 usize:: try_from ( count - 0x800 ) . ok ( )
414414 } else {
Original file line number Diff line number Diff line change @@ -1939,7 +1939,9 @@ fn test_char_range() {
19391939 assert ! ( ( '\0' ..=char :: MAX ) . rev( ) . eq( ( 0 ..=char :: MAX as u32 ) . filter_map( char :: from_u32) . rev( ) ) ) ;
19401940
19411941 assert_eq ! ( ( '\u{D7FF}' ..='\u{E000}' ) . count( ) , 2 ) ;
1942+ assert_eq ! ( ( '\u{D7FF}' ..='\u{E000}' ) . size_hint( ) , ( 2 , Some ( 2 ) ) ) ;
19421943 assert_eq ! ( ( '\u{D7FF}' ..'\u{E000}' ) . count( ) , 1 ) ;
1944+ assert_eq ! ( ( '\u{D7FF}' ..'\u{E000}' ) . size_hint( ) , ( 1 , Some ( 1 ) ) ) ;
19431945}
19441946
19451947#[ test]
You can’t perform that action at this time.
0 commit comments