diff --git a/compute_tools/src/compute.rs b/compute_tools/src/compute.rs index bf6a88261a..7b6f923f7d 100644 --- a/compute_tools/src/compute.rs +++ b/compute_tools/src/compute.rs @@ -889,13 +889,12 @@ impl ComputeNode { /// Check that compute node has corresponding feature enabled. pub fn has_feature(&self, feature: ComputeFeature) -> bool { - let state = self.state.lock().unwrap(); - - if let Some(s) = state.pspec.as_ref() { - s.spec.features.contains(&feature) - } else { - false - } + self.state + .lock() + .unwrap() + .pspec + .as_ref() + .is_some_and(|s| s.spec.features.contains(&feature)) } pub fn set_status(&self, status: ComputeStatus) {