You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2020/12/27 12:40:47 UTC

[arrow] branch master updated: ARROW-11034: [Rust] remove rustfmt ignore list, fix format

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

alamb 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 a11491c  ARROW-11034: [Rust] remove rustfmt ignore list, fix format
a11491c is described below

commit a11491c8f715127261d164a57bbff46ff128a078
Author: mqy <me...@gmail.com>
AuthorDate: Sun Dec 27 07:39:59 2020 -0500

    ARROW-11034: [Rust] remove rustfmt ignore list, fix format
    
    In this PR:
    
    - Ignore list is commented out from rustfmt.toml, thus `carrgo +stable fmt` would not show warnings
    - Two files are re-formatted by nightly, stable: this may avoid formatting problem we had seen in CI (hope so).
    
    Shell commands that I had run:
    ```
    cargo +nightly-2020-11-24-x86_64 fmt
    cargo +1.48.0-x86_64 fmt
    ```
    
    Closes #9013 from mqy/ARROW-11034_rustfmt
    
    Authored-by: mqy <me...@gmail.com>
    Signed-off-by: Andrew Lamb <an...@nerdnetworks.org>
---
 rust/datafusion/src/scalar.rs  | 31 +++++++++++++++++--------------
 rust/parquet/src/record/api.rs |  5 ++++-
 rust/rustfmt.toml              |  6 +++---
 3 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/rust/datafusion/src/scalar.rs b/rust/datafusion/src/scalar.rs
index 321271e..2a2d4d8 100644
--- a/rust/datafusion/src/scalar.rs
+++ b/rust/datafusion/src/scalar.rs
@@ -163,20 +163,23 @@ impl ScalarValue {
 
     /// whether this value is null or not.
     pub fn is_null(&self) -> bool {
-        matches!(*self, ScalarValue::Boolean(None)
-            | ScalarValue::UInt8(None)
-            | ScalarValue::UInt16(None)
-            | ScalarValue::UInt32(None)
-            | ScalarValue::UInt64(None)
-            | ScalarValue::Int8(None)
-            | ScalarValue::Int16(None)
-            | ScalarValue::Int32(None)
-            | ScalarValue::Int64(None)
-            | ScalarValue::Float32(None)
-            | ScalarValue::Float64(None)
-            | ScalarValue::Utf8(None)
-            | ScalarValue::LargeUtf8(None)
-            | ScalarValue::List(None, _))
+        matches!(
+            *self,
+            ScalarValue::Boolean(None)
+                | ScalarValue::UInt8(None)
+                | ScalarValue::UInt16(None)
+                | ScalarValue::UInt32(None)
+                | ScalarValue::UInt64(None)
+                | ScalarValue::Int8(None)
+                | ScalarValue::Int16(None)
+                | ScalarValue::Int32(None)
+                | ScalarValue::Int64(None)
+                | ScalarValue::Float32(None)
+                | ScalarValue::Float64(None)
+                | ScalarValue::Utf8(None)
+                | ScalarValue::LargeUtf8(None)
+                | ScalarValue::List(None, _)
+        )
     }
 
     /// Converts a scalar value into an 1-row array.
diff --git a/rust/parquet/src/record/api.rs b/rust/parquet/src/record/api.rs
index d692bc9..61a5280 100644
--- a/rust/parquet/src/record/api.rs
+++ b/rust/parquet/src/record/api.rs
@@ -537,7 +537,10 @@ impl Field {
 
     /// Determines if this Row represents a primitive value.
     pub fn is_primitive(&self) -> bool {
-        !matches!(*self, Field::Group(_) | Field::ListInternal(_) | Field::MapInternal(_))
+        !matches!(
+            *self,
+            Field::Group(_) | Field::ListInternal(_) | Field::MapInternal(_)
+        )
     }
 
     /// Converts Parquet BOOLEAN type with logical type into `bool` value.
diff --git a/rust/rustfmt.toml b/rust/rustfmt.toml
index d9ad649..c114c6f 100644
--- a/rust/rustfmt.toml
+++ b/rust/rustfmt.toml
@@ -18,6 +18,6 @@
 max_width = 90
 
 # ignore generated files
-ignore = [
-    "arrow/src/ipc/gen",
-]
\ No newline at end of file
+# ignore = [
+#    "arrow/src/ipc/gen",
+#]
\ No newline at end of file