Skip to content

Commit

Permalink
Use let-else
Browse files Browse the repository at this point in the history
  • Loading branch information
martinthomson committed Jan 8, 2024
1 parent bff59d0 commit a25a42d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ohttp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ impl ClientRequest {
/// See `KeyConfig::decode_list` for the structure details.
pub fn from_encoded_config_list(encoded_config_list: &[u8]) -> Res<Self> {
let mut configs = KeyConfig::decode_list(encoded_config_list)?;
let mut config = match configs.pop() {
Some(c) => c,
None => return Err(Error::Unsupported),
let Some(mut config) = configs.pop() else {
return Err(Error::Unsupported);
};
Self::from_config(&mut config)
}
Expand Down

0 comments on commit a25a42d

Please sign in to comment.