From 2aa20f05f73176650d7b4905cb1a5fcf5cba62f2 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Wed, 26 Jun 2024 12:53:42 -0700 Subject: [PATCH] chore: Upgrade to Rust 1.79 (#570) * Upgrade to Rust 1.79 and fix clippy warnings * address feedback --- core/src/execution/datafusion/expressions/cast.rs | 4 ++-- core/src/jvm_bridge/mod.rs | 2 +- rust-toolchain | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/execution/datafusion/expressions/cast.rs b/core/src/execution/datafusion/expressions/cast.rs index 7a71d2017..9e3205cef 100644 --- a/core/src/execution/datafusion/expressions/cast.rs +++ b/core/src/execution/datafusion/expressions/cast.rs @@ -259,7 +259,7 @@ macro_rules! cast_float_to_int16_down { .iter() .map(|value| match value { Some(value) => { - let is_overflow = value.is_nan() || value.abs() as i32 == std::i32::MAX; + let is_overflow = value.is_nan() || value.abs() as i32 == i32::MAX; if is_overflow { return Err(cast_overflow( &format!($format_str, value).replace("e", "E"), @@ -374,7 +374,7 @@ macro_rules! cast_decimal_to_int16_down { Some(value) => { let divisor = 10_i128.pow($scale as u32); let (truncated, decimal) = (value / divisor, (value % divisor).abs()); - let is_overflow = truncated.abs() > std::i32::MAX.into(); + let is_overflow = truncated.abs() > i32::MAX.into(); if is_overflow { return Err(cast_overflow( &format!("{}.{}BD", truncated, decimal), diff --git a/core/src/jvm_bridge/mod.rs b/core/src/jvm_bridge/mod.rs index 5d810edb3..91789adce 100644 --- a/core/src/jvm_bridge/mod.rs +++ b/core/src/jvm_bridge/mod.rs @@ -222,7 +222,7 @@ impl JVMClasses<'_> { JVM_CLASSES.get_or_init(|| { // A hack to make the `JNIEnv` static. It is not safe but we don't really use the // `JNIEnv` except for creating the global references of the classes. - let env = unsafe { std::mem::transmute::<_, &'static mut JNIEnv>(env) }; + let env = unsafe { std::mem::transmute::<&mut JNIEnv, &'static mut JNIEnv>(env) }; let clazz = env.find_class("java/lang/Object").unwrap(); let object_get_class_method = env diff --git a/rust-toolchain b/rust-toolchain index 8e95c75da..17420a571 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.78 +1.79