From 28318d3ea7db87b4729178dced49db62433c6b3c Mon Sep 17 00:00:00 2001 From: Gyubong Lee Date: Fri, 17 May 2024 02:27:13 +0000 Subject: [PATCH] refactor: Remove useless return statement --- src/lock_manager.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lock_manager.rs b/src/lock_manager.rs index 84fd4f6..b161a29 100644 --- a/src/lock_manager.rs +++ b/src/lock_manager.rs @@ -124,8 +124,8 @@ impl EtcdLockManager { }; match timeout_result { - Ok(Ok(_)) => {} - Ok(Err(try_lock_err)) => return Err(try_lock_err.into()), + Ok(Ok(_)) => Ok(PyCommunicator::new(client)), + Ok(Err(try_lock_err)) => Err(try_lock_err.into()), Err(timedout_err) => { if let Some(lease_id) = self_.lease_id { if let Err(etcd_client::Error::GRpcStatus(status)) = @@ -136,11 +136,9 @@ impl EtcdLockManager { } } } - return Err(LockError::new_err(timedout_err.to_string())); + Err(LockError::new_err(timedout_err.to_string())) } } - - return Ok(PyCommunicator::new(client)); } pub async fn handle_aexit(&mut self) -> PyResult<()> {