From 879b75419bea773122657665e8744797efa9be15 Mon Sep 17 00:00:00 2001
From: Remzi Yang <59198230+HaoYang670@users.noreply.github.com>
Date: Fri, 25 Feb 2022 20:19:05 +0800
Subject: [PATCH] Fix clippy lints (#1885)
* fix some lints
Signed-off-by: remzi <13716567376yh@gmail.com>
* fix some lints
Signed-off-by: remzi <13716567376yh@gmail.com>
* fix some lints
Signed-off-by: remzi <13716567376yh@gmail.com>
* fix some lints
Signed-off-by: remzi <13716567376yh@gmail.com>
* fix all lints
Signed-off-by: remzi <13716567376yh@gmail.com>
---
ballista/rust/core/src/serde/logical_plan/to_proto.rs | 2 +-
datafusion/fuzz-utils/src/lib.rs | 9 +++------
datafusion/src/execution/context.rs | 6 +++---
datafusion/src/logical_plan/builder.rs | 3 +--
datafusion/src/logical_plan/plan.rs | 3 +--
datafusion/src/optimizer/filter_push_down.rs | 3 +--
datafusion/src/physical_plan/hash_aggregate.rs | 10 +++++-----
datafusion/src/physical_plan/regex_expressions.rs | 2 +-
datafusion/src/physical_plan/union.rs | 6 ++----
datafusion/src/physical_plan/values.rs | 2 +-
datafusion/tests/merge_fuzz.rs | 3 +--
datafusion/tests/order_spill_fuzz.rs | 3 +--
12 files changed, 21 insertions(+), 31 deletions(-)
diff --git a/ballista/rust/core/src/serde/logical_plan/to_proto.rs b/ballista/rust/core/src/serde/logical_plan/to_proto.rs
index 16f19b0f4b28..9cb8c4166c93 100644
--- a/ballista/rust/core/src/serde/logical_plan/to_proto.rs
+++ b/ballista/rust/core/src/serde/logical_plan/to_proto.rs
@@ -198,7 +198,7 @@ impl From<&DataType> for protobuf::arrow_type::ArrowTypeEnum {
DataType::Timestamp(time_unit, timezone) => {
ArrowTypeEnum::Timestamp(protobuf::Timestamp {
time_unit: protobuf::TimeUnit::from_arrow_time_unit(time_unit) as i32,
- timezone: timezone.to_owned().unwrap_or_else(String::new),
+ timezone: timezone.to_owned().unwrap_or_default(),
})
}
DataType::Date32 => ArrowTypeEnum::Date32(EmptyMessage {}),
diff --git a/datafusion/fuzz-utils/src/lib.rs b/datafusion/fuzz-utils/src/lib.rs
index e021f55f8724..920a9bc8d2f1 100644
--- a/datafusion/fuzz-utils/src/lib.rs
+++ b/datafusion/fuzz-utils/src/lib.rs
@@ -26,7 +26,7 @@ pub use env_logger;
pub fn batches_to_vec(batches: &[RecordBatch]) -> Vec