From 6ae9451307b38275f7d10cb58e6bc17be1749c6e Mon Sep 17 00:00:00 2001 From: Gonzalo <456459+grzuy@users.noreply.github.com> Date: Thu, 26 Oct 2023 10:05:19 -0300 Subject: [PATCH] style: cargo clippy fixes --- native/candlex/src/ops.rs | 4 ++-- native/candlex/src/tensors.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/native/candlex/src/ops.rs b/native/candlex/src/ops.rs index 36450c5..98bc300 100644 --- a/native/candlex/src/ops.rs +++ b/native/candlex/src/ops.rs @@ -410,8 +410,8 @@ custom_unary_op!(Atanh, "atanh", |v| v.atanh(), (BF16, F16, F32, F64)); custom_unary_op!(BitNot, "bit_not", |v| !v, (U8, U32, I64)); custom_unary_op!(Cbrt, "cbrt", |v| v.cbrt(), (BF16, F16, F32, F64)); custom_unary_op!(Cosh, "cosh", |v| v.cosh(), (BF16, F16, F32, F64)); -custom_unary_op!(Erfc, "erfc", |v| erfc(v), (BF16, F16, F32, F64)); -custom_unary_op!(ErfInv, "erf_inv", |v| erf_inv(v), (BF16, F16, F32, F64)); +custom_unary_op!(Erfc, "erfc", erfc, (BF16, F16, F32, F64)); +custom_unary_op!(ErfInv, "erf_inv", erf_inv, (BF16, F16, F32, F64)); custom_unary_op!(Expm1, "expm1", |v| v.exp_m1(), (BF16, F16, F32, F64)); custom_unary_op!(Log1p, "ln_1p", |v| v.ln_1p(), (BF16, F16, F32, F64)); custom_unary_op!(Sigmoid, "sigmoid", |v| 1. / (1. + (-v).exp()), (F32, F64)); diff --git a/native/candlex/src/tensors.rs b/native/candlex/src/tensors.rs index 3ea396a..03b8a71 100644 --- a/native/candlex/src/tensors.rs +++ b/native/candlex/src/tensors.rs @@ -115,7 +115,7 @@ pub fn index_add( pub fn chunk(t: ExTensor, num_chunks: usize) -> Result, CandlexError> { Ok(t.chunk(num_chunks, 0)? .into_iter() - .map(|t| ExTensor::new(t)) + .map(ExTensor::new) .collect()) } @@ -447,10 +447,10 @@ custom_binary_nif!(right_shift, Shr); custom_binary_nif!(remainder, Remainder); fn tuple_to_vec(term: Term) -> Result, rustler::Error> { - Ok(rustler::types::tuple::get_tuple(term)? + rustler::types::tuple::get_tuple(term)? .iter() .map(|elem| elem.decode()) - .collect::>()?) + .collect::>() } fn vec_to_tuple(env: Env, vec: Vec) -> Result {