diff --git a/ballista/cache/src/listener/loading_cache.rs b/ballista/cache/src/listener/loading_cache.rs index e54e7d831..09f61c3b3 100644 --- a/ballista/cache/src/listener/loading_cache.rs +++ b/ballista/cache/src/listener/loading_cache.rs @@ -145,7 +145,7 @@ where fn listen_on_get_if_present(&self, k: Self::K, v: Option) { if self.listeners.len() == 1 { self.listeners - .get(0) + .first() .unwrap() .listen_on_get_if_present(k, v); } else { @@ -157,7 +157,7 @@ where fn listen_on_get(&self, k: Self::K, v: Self::V, status: CacheGetStatus) { if self.listeners.len() == 1 { - self.listeners.get(0).unwrap().listen_on_get(k, v, status); + self.listeners.first().unwrap().listen_on_get(k, v, status); } else { self.listeners.iter().for_each(|listener| { listener.listen_on_get(k.clone(), v.clone(), status) @@ -167,7 +167,7 @@ where fn listen_on_put(&self, k: Self::K, v: Self::V) { if self.listeners.len() == 1 { - self.listeners.get(0).unwrap().listen_on_put(k, v); + self.listeners.first().unwrap().listen_on_put(k, v); } else { self.listeners .iter() @@ -177,7 +177,7 @@ where fn listen_on_invalidate(&self, k: Self::K) { if self.listeners.len() == 1 { - self.listeners.get(0).unwrap().listen_on_invalidate(k); + self.listeners.first().unwrap().listen_on_invalidate(k); } else { self.listeners .iter() @@ -187,7 +187,7 @@ where fn listen_on_get_cancelling(&self, k: Self::K) { if self.listeners.len() == 1 { - self.listeners.get(0).unwrap().listen_on_get_cancelling(k); + self.listeners.first().unwrap().listen_on_get_cancelling(k); } else { self.listeners .iter() diff --git a/ballista/scheduler/src/cluster/storage/etcd.rs b/ballista/scheduler/src/cluster/storage/etcd.rs index 528a9116b..514511c91 100644 --- a/ballista/scheduler/src/cluster/storage/etcd.rs +++ b/ballista/scheduler/src/cluster/storage/etcd.rs @@ -57,7 +57,7 @@ impl KeyValueStore for EtcdClient { .await .map_err(|e| ballista_error(&format!("etcd error {e:?}")))? .kvs() - .get(0) + .first() .map(|kv| kv.value().to_owned()) .unwrap_or_default()) } @@ -181,7 +181,7 @@ impl KeyValueStore for EtcdClient { .await .map_err(|e| ballista_error(&format!("etcd error {e:?}")))? .kvs() - .get(0) + .first() .map(|kv| kv.value().to_owned()); if let Some(value) = current_value { diff --git a/ballista/scheduler/src/state/task_manager.rs b/ballista/scheduler/src/state/task_manager.rs index 02b908616..66714e6cf 100644 --- a/ballista/scheduler/src/state/task_manager.rs +++ b/ballista/scheduler/src/state/task_manager.rs @@ -557,7 +557,7 @@ impl TaskManager &self, tasks: Vec, ) -> Result> { - if let Some(task) = tasks.get(0) { + if let Some(task) = tasks.first() { let session_id = task.session_id.clone(); let job_id = task.partition.job_id.clone(); let stage_id = task.partition.stage_id;