diff --git a/drivers/android/process.rs b/drivers/android/process.rs index 6df6678bae6b75..e24b4fce543b48 100644 --- a/drivers/android/process.rs +++ b/drivers/android/process.rs @@ -186,10 +186,9 @@ impl ProcessInner { strong: bool, thread: Option<&Thread>, ) -> Result> { - Ok(match self.get_existing_node(ptr, cookie)? { - None => None, - Some(node) => Some(self.new_node_ref(node, strong, thread)), - }) + Ok(self + .get_existing_node(ptr, cookie)? + .map(|node| self.new_node_ref(node, strong, thread))) } fn register_thread(&mut self) -> bool {