Skip to content

Commit e14e5f2

Browse files
authored
Merge branch 'main' into dependabot/cargo/rand-0.9
2 parents a801247 + 36e987b commit e14e5f2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/ci.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: CI
22

33
on:
44
push:
5+
branches: [ main ]
6+
pull_request:
7+
workflow_dispatch:
58

69
permissions:
710
contents: read

crates/string-offsets/src/lib.rs

+2-2
Original file line numberDiff line numberDiff 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.
386386
fn 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

392392
fn utf8_to_utf16_width(content: &[u8]) -> usize {

0 commit comments

Comments
 (0)