8000 Widen ScriptExtensions · unicode-rs/unicode-script@0cfeeb6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0cfeeb6

Browse files
committed
Widen ScriptExtensions
1 parent 4c4b6e3 commit 0cfeeb6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,20 @@ pub struct ScriptExtension {
144144
// A bitset for the scripts 65-128
145145
second: u64,
146146
// A bitset for scripts after 128
147-
third: u32,
147+
third: u64,
148148
// Both Common and Inherited are represented by all used bits being set,
149149
// this flag lets us distinguish the two.
150150
common: bool,
151151
}
152152

153153
impl ScriptExtension {
154-
// We don't use the complete u32 of `third`, so the "all" value is not just u32::MAX
154+
// We don't use the complete u64 of `third`, so the "all" value is not just u32::MAX
155155
// Instead, we take the number of the next (unused) script bit, subtract 128 to bring
156-
// it in the range of `third`, create a u32 with just that bit set, and subtract 1
156+
// it in the range of `third`, create a u64 with just that bit set, and subtract 1
157157
// to create one with all the lower bits set.
158-
const THIRD_MAX: u32 = ((1 << (NEXT_SCRIPT - 128)) - 1);
158+
const THIRD_MAX: u64 = ((1 << (NEXT_SCRIPT - 128)) - 1);
159159

160-
pub(crate) const fn new(first: u64, second: u64, third: u32) -> Self {
160+
pub(crate) const fn new(first: u64, second: u64, third: u64) -> Self {
161161
ScriptExtension {
162162
first,
163163
second,

0 commit comments

Comments
 (0)
0