Skip to content

Commit

Permalink
fix: fix #12
Browse files Browse the repository at this point in the history
  • Loading branch information
null8626 committed Oct 28, 2024
1 parent c2e20d5 commit e19fd59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/codepoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const STRING_TRANSLATION_MASK: u32 = 0x40000000;
pub(crate) struct Codepoint(u32, u8);

impl Codepoint {
pub(crate) const fn at(offset: u16) -> Self {
pub(crate) const fn at(offset: i32) -> Self {
unsafe {
Self(
read_u32_le(CODEPOINTS.offset(offset as _)),
Expand Down
8 changes: 4 additions & 4 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use codepoints::{
};
use core::cmp::Ordering;

fn translate(code: u32, offset: u16, mut end: u16) -> Option<Translation> {
fn translate(code: u32, offset: i32, mut end: i32) -> Option<Translation> {
let mut start = 0;

while start <= end {
Expand Down Expand Up @@ -91,14 +91,14 @@ where
} else if code != code_lowercased {
if let Some(translation) = translate(
code,
CASE_SENSITIVE_CODEPOINTS_OFFSET,
CASE_SENSITIVE_CODEPOINTS_COUNT,
CASE_SENSITIVE_CODEPOINTS_OFFSET as _,
CASE_SENSITIVE_CODEPOINTS_COUNT as _,
) {
return translation;
}
}

translate(code_lowercased, 6, CODEPOINTS_COUNT).unwrap_or(Translation::character(code_lowercased))
translate(code_lowercased, 6, CODEPOINTS_COUNT as _).unwrap_or(Translation::character(code_lowercased))
}

/// Cures a string.
Expand Down

0 comments on commit e19fd59

Please sign in to comment.