From 0376b7557ce62b3329c1746b04607f7330a3e3ff Mon Sep 17 00:00:00 2001 From: WATANABE Shinya Date: Fri, 21 Feb 2025 20:08:09 +0900 Subject: [PATCH] fix(core): fix incompatibilities caused by the latest cargo fix --- llrt_core/src/modules/console.rs | 3 ++- llrt_core/src/modules/llrt/uuid.rs | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/llrt_core/src/modules/console.rs b/llrt_core/src/modules/console.rs index 31a7ce6e0c..72524538e1 100644 --- a/llrt_core/src/modules/console.rs +++ b/llrt_core/src/modules/console.rs @@ -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]); } diff --git a/llrt_core/src/modules/llrt/uuid.rs b/llrt_core/src/modules/llrt/uuid.rs index 4f0732454f..e14c033c9c 100644 --- a/llrt_core/src/modules/llrt/uuid.rs +++ b/llrt_core/src/modules/llrt/uuid.rs @@ -102,18 +102,18 @@ fn uuidv6_to_v1<'js>(ctx: Ctx<'js>, v6_value: Value<'js>) -> Result { 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]);