File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
crates/string-offsets/src Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 22
33on :
44 push :
5+ branches : [ main ]
6+ pull_request :
7+ workflow_dispatch :
58
69permissions :
710 contents : read
Original file line number Diff line number Diff line change @@ -385,8 +385,8 @@ fn new_converter(content: &[u8]) -> StringOffsets {
385385/// Returns 0 if the byte is not a valid first byte of a UTF-8 char.
386386fn utf8_width ( c : u8 ) -> usize {
387387 // Every nibble represents the utf8 length given the first 4 bits of a utf8 encoded byte.
388- const UTF8_WIDTH : usize = 0x4322_0000_1111_1111 ;
389- ( UTF8_WIDTH >> ( ( c >> 4 ) * 4 ) ) & 0xf
388+ const UTF8_WIDTH : u64 = 0x4322_0000_1111_1111 ;
389+ ( ( UTF8_WIDTH >> ( ( c >> 4 ) * 4 ) ) & 0xf ) as usize
390390}
391391
392392fn utf8_to_utf16_width ( content : & [ u8 ] ) -> usize {
You can’t perform that action at this time.
0 commit comments