Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): fix incompatibilities caused by the latest cargo fix #847

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion llrt_core/src/modules/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ pub fn init(ctx: &Ctx<'_>) -> Result<()> {
#[inline(always)]
fn write_sep(result: &mut String, add_comma: bool, has_indentation: bool, newline: bool) {
const SEPARATOR_TABLE: [&str; 8] = ["", ",", "\r", ",\r", " ", ", ", "\n", ",\n"];
let index = (add_comma as usize) | (has_indentation as usize) << 1 | (newline as usize) << 2;
let index =
(add_comma as usize) | ((has_indentation as usize) << 1) | ((newline as usize) << 2);
result.push_str(SEPARATOR_TABLE[index]);
}

Expand Down
14 changes: 7 additions & 7 deletions llrt_core/src/modules/llrt/uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ fn uuidv6_to_v1<'js>(ctx: Ctx<'js>, v6_value: Value<'js>) -> Result<String> {
let mut v1_bytes = [0u8; 16];

// time_low
v1_bytes[0] = (v6_bytes[3] & 0x0f) << 4 | (v6_bytes[4] & 0xf0) >> 4;
v1_bytes[1] = (v6_bytes[4] & 0x0f) << 4 | (v6_bytes[5] & 0xf0) >> 4;
v1_bytes[2] = (v6_bytes[5] & 0x0f) << 4 | (v6_bytes[6] & 0x0f);
v1_bytes[0] = ((v6_bytes[3] & 0x0f) << 4) | ((v6_bytes[4] & 0xf0) >> 4);
v1_bytes[1] = ((v6_bytes[4] & 0x0f) << 4) | ((v6_bytes[5] & 0xf0) >> 4);
v1_bytes[2] = ((v6_bytes[5] & 0x0f) << 4) | (v6_bytes[6] & 0x0f);
v1_bytes[3] = v6_bytes[7];

// time_mid
v1_bytes[4] = (v6_bytes[1] & 0x0f) << 4 | (v6_bytes[2] & 0xf0) >> 4;
v1_bytes[5] = (v6_bytes[2] & 0x0f) << 4 | (v6_bytes[3] & 0xf0) >> 4;
v1_bytes[4] = ((v6_bytes[1] & 0x0f) << 4) | ((v6_bytes[2] & 0xf0) >> 4);
v1_bytes[5] = ((v6_bytes[2] & 0x0f) << 4) | ((v6_bytes[3] & 0xf0) >> 4);

// version and time_high
v1_bytes[6] = 0x10 | (v6_bytes[0] & 0xf0) >> 4;
v1_bytes[7] = (v6_bytes[0] & 0x0f) << 4 | (v6_bytes[1] & 0xf0) >> 4;
v1_bytes[6] = 0x10 | ((v6_bytes[0] & 0xf0) >> 4);
v1_bytes[7] = ((v6_bytes[0] & 0x0f) << 4) | ((v6_bytes[1] & 0xf0) >> 4);

// clock_seq and node
v1_bytes[8..16].copy_from_slice(&v6_bytes[8..16]);
Expand Down
Loading