You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ne...@apache.org on 2021/03/27 23:01:41 UTC

[arrow] branch master updated: ARROW-12116: [Rust] Fix and ignore 1.51 clippy lints

This is an automated email from the ASF dual-hosted git repository.

nevime pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 60011c0  ARROW-12116: [Rust] Fix and ignore 1.51 clippy lints
60011c0 is described below

commit 60011c081508b09724469d7a4d1d93b4bd015fe4
Author: Neville Dipale <ne...@gmail.com>
AuthorDate: Sun Mar 28 00:59:48 2021 +0200

    ARROW-12116: [Rust] Fix and ignore 1.51 clippy lints
    
    There's an acronym Rust lint that started failing after 1.51 was announced. The lint is in the `arrow::ffi` and `arrow::ipc::gen` modules, so I'm instead ignoring it and documenting this.
    
    Closes #9815 from nevi-me/1-51-lints
    
    Authored-by: Neville Dipale <ne...@gmail.com>
    Signed-off-by: Neville Dipale <ne...@gmail.com>
---
 rust/arrow/src/lib.rs                       | 13 ++++++++++---
 rust/arrow/src/util/pretty.rs               |  3 +--
 rust/datafusion/src/lib.rs                  |  4 +++-
 rust/datafusion/src/logical_plan/builder.rs |  4 ++--
 rust/parquet/src/lib.rs                     |  5 ++++-
 5 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/rust/arrow/src/lib.rs b/rust/arrow/src/lib.rs
index 68a820b..30f968c9 100644
--- a/rust/arrow/src/lib.rs
+++ b/rust/arrow/src/lib.rs
@@ -129,11 +129,18 @@
 #![cfg_attr(feature = "avx512", feature(avx512_target_feature))]
 #![allow(dead_code)]
 #![allow(non_camel_case_types)]
+#![deny(clippy::redundant_clone)]
+#![allow(
+    // introduced to ignore lint errors when upgrading from 2020-04-22 to 2020-11-14
+    clippy::float_equality_without_abs,
+    clippy::type_complexity,
+    // upper_case_acronyms lint was introduced in Rust 1.51.
+    // It is triggered in the ffi module, and ipc::gen, which we have no control over
+    clippy::upper_case_acronyms,
+    clippy::vec_init_then_push
+)]
 #![allow(bare_trait_objects)]
 #![warn(missing_debug_implementations)]
-#![deny(clippy::redundant_clone)]
-// introduced to ignore lint errors when upgrading from 2020-04-22 to 2020-11-14
-#![allow(clippy::float_equality_without_abs, clippy::type_complexity)]
 
 pub mod alloc;
 mod arch;
diff --git a/rust/arrow/src/util/pretty.rs b/rust/arrow/src/util/pretty.rs
index 7baf559..f354899 100644
--- a/rust/arrow/src/util/pretty.rs
+++ b/rust/arrow/src/util/pretty.rs
@@ -93,8 +93,7 @@ fn create_column(field: &str, columns: &[ArrayRef]) -> Result<Table> {
 
     for col in columns {
         for row in 0..col.len() {
-            let mut cells = Vec::new();
-            cells.push(Cell::new(&array_value_to_string(&col, row)?));
+            let cells = vec![Cell::new(&array_value_to_string(&col, row)?)];
             table.add_row(Row::new(cells));
         }
     }
diff --git a/rust/datafusion/src/lib.rs b/rust/datafusion/src/lib.rs
index 3e1e1e2..2733430 100644
--- a/rust/datafusion/src/lib.rs
+++ b/rust/datafusion/src/lib.rs
@@ -18,9 +18,11 @@
 // Clippy lints, some should be disabled incrementally
 #![allow(
     clippy::float_cmp,
+    clippy::from_over_into,
     clippy::module_inception,
     clippy::new_without_default,
-    clippy::type_complexity
+    clippy::type_complexity,
+    clippy::upper_case_acronyms
 )]
 
 //! [DataFusion](https://github.com/apache/arrow/tree/master/rust/datafusion)
diff --git a/rust/datafusion/src/logical_plan/builder.rs b/rust/datafusion/src/logical_plan/builder.rs
index aa0380e..e748872 100644
--- a/rust/datafusion/src/logical_plan/builder.rs
+++ b/rust/datafusion/src/logical_plan/builder.rs
@@ -303,8 +303,8 @@ impl LogicalPlanBuilder {
 
         Ok(Self::from(&LogicalPlan::Aggregate {
             input: Arc::new(self.plan.clone()),
-            group_expr: group_expr,
-            aggr_expr: aggr_expr,
+            group_expr,
+            aggr_expr,
             schema: DFSchemaRef::new(aggr_schema),
         }))
     }
diff --git a/rust/parquet/src/lib.rs b/rust/parquet/src/lib.rs
index 19e1a0f..a931b95 100644
--- a/rust/parquet/src/lib.rs
+++ b/rust/parquet/src/lib.rs
@@ -23,13 +23,16 @@
     clippy::cast_ptr_alignment,
     clippy::float_cmp,
     clippy::float_equality_without_abs,
+    clippy::from_over_into,
     clippy::many_single_char_names,
     clippy::needless_range_loop,
     clippy::new_without_default,
     clippy::or_fun_call,
     clippy::same_item_push,
     clippy::too_many_arguments,
-    clippy::transmute_ptr_to_ptr
+    clippy::transmute_ptr_to_ptr,
+    clippy::upper_case_acronyms,
+    clippy::vec_init_then_push
 )]
 
 #[macro_use]