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 2
2
3
3
on :
4
4
push :
5
+ branches : [ main ]
6
+ pull_request :
7
+ workflow_dispatch :
5
8
6
9
permissions :
7
10
contents : read
Original file line number Diff line number Diff line change @@ -385,8 +385,8 @@ fn new_converter(content: &[u8]) -> StringOffsets {
385
385
/// Returns 0 if the byte is not a valid first byte of a UTF-8 char.
386
386
fn utf8_width ( c : u8 ) -> usize {
387
387
// 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
390
390
}
391
391
392
392
fn utf8_to_utf16_width ( content : & [ u8 ] ) -> usize {
You can’t perform that action at this time.
0 commit comments