From e0afc6e2a84c6fab3ddd0f5eb62eca7c34039eb5 Mon Sep 17 00:00:00 2001
From: yangzhong <yangzhong@ebay.com>
Date: Mon, 17 Jul 2023 18:31:04 +0800
Subject: [PATCH] Fix cargo clippy for latest rust version

---
 ballista/cache/src/backend/policy/lru/mod.rs        | 4 ++--
 ballista/scheduler/src/cluster/memory.rs            | 2 +-
 ballista/scheduler/src/cluster/mod.rs               | 2 +-
 ballista/scheduler/src/state/execution_graph_dot.rs | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ballista/cache/src/backend/policy/lru/mod.rs b/ballista/cache/src/backend/policy/lru/mod.rs
index 24d53a7d3..a63e5d04a 100644
--- a/ballista/cache/src/backend/policy/lru/mod.rs
+++ b/ballista/cache/src/backend/policy/lru/mod.rs
@@ -83,8 +83,8 @@ where
         Self {
             max_num: capacity,
             current_num: 0,
-            _key_marker: PhantomData::default(),
-            _value_marker: PhantomData::default(),
+            _key_marker: PhantomData,
+            _value_marker: PhantomData,
         }
     }
 }
diff --git a/ballista/scheduler/src/cluster/memory.rs b/ballista/scheduler/src/cluster/memory.rs
index 6060e79c1..b9dcef406 100644
--- a/ballista/scheduler/src/cluster/memory.rs
+++ b/ballista/scheduler/src/cluster/memory.rs
@@ -98,7 +98,7 @@ impl ClusterState for InMemoryClusterState {
         let mut guard = self.task_slots.lock().await;
 
         for (executor_id, num_slots) in increments {
-            if let Some(mut data) = guard.get_mut(&executor_id) {
+            if let Some(data) = guard.get_mut(&executor_id) {
                 data.slots += num_slots;
             }
         }
diff --git a/ballista/scheduler/src/cluster/mod.rs b/ballista/scheduler/src/cluster/mod.rs
index 87680ac05..c30111848 100644
--- a/ballista/scheduler/src/cluster/mod.rs
+++ b/ballista/scheduler/src/cluster/mod.rs
@@ -513,7 +513,7 @@ pub(crate) async fn bind_task_round_robin(
                 }
                 // Since the slots is a vector with descending order, and the total available slots is larger than 0,
                 // we are sure the available slot number at idx_slot is larger than 1
-                let mut slot = &mut slots[idx_slot];
+                let slot = &mut slots[idx_slot];
                 let executor_id = slot.executor_id.clone();
                 let task_id = *task_id_gen;
                 *task_id_gen += 1;
diff --git a/ballista/scheduler/src/state/execution_graph_dot.rs b/ballista/scheduler/src/state/execution_graph_dot.rs
index ce672f26b..028c0bd2e 100644
--- a/ballista/scheduler/src/state/execution_graph_dot.rs
+++ b/ballista/scheduler/src/state/execution_graph_dot.rs
@@ -69,7 +69,7 @@ impl<'a> ExecutionGraphDot<'a> {
             writeln!(&mut dot, "}}")?;
             Ok(dot)
         } else {
-            Err(fmt::Error::default())
+            Err(fmt::Error)
         }
     }