From 6c10e3d056bcc46f0e99bcf7800724b573945441 Mon Sep 17 00:00:00 2001 From: lyken Date: Fri, 12 Jul 2024 21:18:53 +0800 Subject: [PATCH] core: cargo clippy --- nac3core/src/codegen/builtin_fns.rs | 6 +++--- nac3core/src/toplevel/builtins.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nac3core/src/codegen/builtin_fns.rs b/nac3core/src/codegen/builtin_fns.rs index f9137789..63078107 100644 --- a/nac3core/src/codegen/builtin_fns.rs +++ b/nac3core/src/codegen/builtin_fns.rs @@ -793,8 +793,8 @@ pub fn call_max<'ctx>( } } -/// Invokes the np_max, np_min, np_argmax, np_argmin functions -/// * `fn_name`: Can be one of "np_argmin", "np_argmax", "np_max", "np_min" +/// Invokes the `np_max`, `np_min`, `np_argmax`, `np_argmin` functions +/// * `fn_name`: Can be one of `"np_argmin"`, `"np_argmax"`, `"np_max"`, `"np_min"` pub fn call_numpy_max_min<'ctx, G: CodeGenerator + ?Sized>( generator: &mut G, ctx: &mut CodeGenContext<'ctx, '_>, @@ -844,7 +844,7 @@ pub fn call_numpy_max_min<'ctx, G: CodeGenerator + ?Sized>( generator, n_sz_eqz, "0:ValueError", - format!("zero-size array to reduction operation {}", fn_name).as_str(), + format!("zero-size array to reduction operation {fn_name}").as_str(), [None, None, None], ctx.current_loc, ); diff --git a/nac3core/src/toplevel/builtins.rs b/nac3core/src/toplevel/builtins.rs index ab639ed1..bcb3c433 100644 --- a/nac3core/src/toplevel/builtins.rs +++ b/nac3core/src/toplevel/builtins.rs @@ -1592,7 +1592,7 @@ impl<'a> BuiltinBuilder<'a> { let a_ty = fun.0.args[0].ty; let a = args[0].1.clone().to_basic_value_enum(ctx, generator, a_ty)?; - Ok(Some(builtin_fns::call_numpy_max_min(generator, ctx, (a_ty, a), &prim.name())?)) + Ok(Some(builtin_fns::call_numpy_max_min(generator, ctx, (a_ty, a), prim.name())?)) }), ) }