Skip to content

Commit

Permalink
chore: merge unreachable branch in new_from_result
Browse files Browse the repository at this point in the history
Signed-off-by: bsbds <69835502+bsbds@users.noreply.github.com>
  • Loading branch information
bsbds committed Sep 6, 2023
1 parent 4978e2f commit 6092e82
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions curp/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,12 @@ impl WaitSyncedResponse {
asr: Option<Result<C::ASR, C::Error>>,
) -> Self {
match (er, asr) {
(None, Some(_)) => {
(None, Some(_)) | (Some(Err(_)), Some(_)) => {
unreachable!("should not call after sync if execution fails")
}
(None, None) => WaitSyncedResponse::new_error::<C>(
WaitSyncError::Other("can't get er result".to_owned()).into(),
), // this is highly unlikely to happen,
(Some(Err(_)), Some(_)) => {
unreachable!("should not call after_sync when exe failed")
}
(Some(Err(err)), None) => {
WaitSyncedResponse::new_error(CommandSyncError::<C>::Execute(err))
}
Expand Down

0 comments on commit 6092e82

Please sign in to comment.