Skip to content

Commit

Permalink
refactor: Remove useless return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed May 17, 2024
1 parent f47ef16 commit 28318d3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lock_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) =
Expand All @@ -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<()> {
Expand Down

0 comments on commit 28318d3

Please # to comment.