From 76016a26ad7c2e515e22d54cca00976078e3b46d Mon Sep 17 00:00:00 2001 From: David Mak Date: Tue, 20 Aug 2024 11:29:03 +0800 Subject: [PATCH] [meta] Apply clippy suggestions --- nac3core/src/codegen/generator.rs | 2 +- nac3core/src/codegen/irrt/mod.rs | 3 ++- nac3core/src/codegen/llvm_intrinsics.rs | 3 ++- nac3core/src/codegen/numpy.rs | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/nac3core/src/codegen/generator.rs b/nac3core/src/codegen/generator.rs index e0e89c309..6a6b46ddc 100644 --- a/nac3core/src/codegen/generator.rs +++ b/nac3core/src/codegen/generator.rs @@ -59,7 +59,7 @@ pub trait CodeGenerator { /// function is a class method. /// /// Note that this function should check if the function is generated in another thread (due to - /// possible race condition), see the default implementation for an example. + /// possible race condition), see the default implementation for an example. fn gen_func_instance<'ctx>( &mut self, ctx: &mut CodeGenContext<'ctx, '_>, diff --git a/nac3core/src/codegen/irrt/mod.rs b/nac3core/src/codegen/irrt/mod.rs index 53b3aba60..91e62e942 100644 --- a/nac3core/src/codegen/irrt/mod.rs +++ b/nac3core/src/codegen/irrt/mod.rs @@ -568,7 +568,8 @@ pub fn call_j0<'ctx>(ctx: &CodeGenContext<'ctx, '_>, v: FloatValue<'ctx>) -> Flo /// /// * `dims` - An [`ArrayLikeIndexer`] containing the size of each dimension. /// * `range` - The dimension index to begin and end (exclusively) calculating the dimensions for, -/// or [`None`] if starting from the first dimension and ending at the last dimension respectively. +/// or [`None`] if starting from the first dimension and ending at the last dimension +/// respectively. pub fn call_ndarray_calc_size<'ctx, G, Dims>( generator: &G, ctx: &CodeGenContext<'ctx, '_>, diff --git a/nac3core/src/codegen/llvm_intrinsics.rs b/nac3core/src/codegen/llvm_intrinsics.rs index ade0f917c..c4a0d4300 100644 --- a/nac3core/src/codegen/llvm_intrinsics.rs +++ b/nac3core/src/codegen/llvm_intrinsics.rs @@ -206,7 +206,8 @@ pub fn call_memcpy_generic<'ctx>( /// * `$name:ident`: Optional name to be assigned to the llvm build call (Option<&str>) /// * `$llvm_name:literal`: Name of underlying llvm intrinsic function /// * `$map_fn:ident`: Mapping function to be applied on `BasicValue` (`BasicValue` -> Function Return Type). -/// Use `BasicValueEnum::into_int_value` for Integer return type and `BasicValueEnum::into_float_value` for Float return type +/// Use `BasicValueEnum::into_int_value` for Integer return type and +/// `BasicValueEnum::into_float_value` for Float return type /// * `$llvm_ty:ident`: Type of first operand /// * `,($val:ident)*`: Comma separated list of operands macro_rules! generate_llvm_intrinsic_fn_body { diff --git a/nac3core/src/codegen/numpy.rs b/nac3core/src/codegen/numpy.rs index 6c5269289..d58b566b2 100644 --- a/nac3core/src/codegen/numpy.rs +++ b/nac3core/src/codegen/numpy.rs @@ -2144,7 +2144,8 @@ pub fn ndarray_transpose<'ctx, G: CodeGenerator + ?Sized>( /// 1. A list of `int32`; e.g., `np.reshape(arr, [600, -1, 3])` /// 2. A tuple of `int32`; e.g., `np.reshape(arr, (-1, 800, 3))` /// 3. A scalar `int32`; e.g., `np.reshape(arr, 3)` -/// Note that unlike other generating functions, one of the dimesions in the shape can be negative +/// +/// Note that unlike other generating functions, one of the dimensions in the shape can be negative. pub fn ndarray_reshape<'ctx, G: CodeGenerator + ?Sized>( generator: &mut G, ctx: &mut CodeGenContext<'ctx, '_>,