Skip to content

Commit

Permalink
remove 'let .. else' to adhere to MSRV
Browse files Browse the repository at this point in the history
  • Loading branch information
squell authored and davidv1992 committed Sep 18, 2024
1 parent 616f1bc commit 997fe0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rustls/src/client/hs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,12 @@ fn emit_client_hello_for_retry(
}

if let Some(challenge) = retryreq.and_then(|r| r.puzzle_challenge()) {
let Some(solution) = challenge.solve() else {
return Err(cx.common.send_fatal_alert(
let solution = challenge.solve().ok_or_else(|| {
cx.common.send_fatal_alert(
AlertDescription::IllegalParameter,
PeerMisbehaved::IllegalHelloRetryRequestWithUnsolvablePuzzle,
));
};
)
})?;
exts.push(ClientExtension::ClientPuzzle(solution));
} else {
exts.push(ClientExtension::ClientPuzzle(
Expand Down

0 comments on commit 997fe0b

Please sign in to comment.