Skip to content

Commit

Permalink
refactor(jans-cedarling): replace if statement with match
Browse files Browse the repository at this point in the history
Signed-off-by: rmarinn <[email protected]>
  • Loading branch information
rmarinn committed Nov 6, 2024
1 parent 258045e commit 59612b9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions jans-cedarling/cedarling/src/jwt/decoding_strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,10 @@ fn decode_and_validate_jwt<T: DeserializeOwned>(
validator.required_spec_claims.clear();
validator.validate_nbf = args.validate_nbf;
validator.validate_exp = args.validate_exp;
if args.aud.is_none() {
validator.validate_aud = false;
} else {
validator.aud.set_optional_claim(args.aud);
}
match args.aud {
Some(_) => validator.aud.set_optional_claim(args.aud),
None => validator.validate_aud = false,
};
validator.iss.set_optional_claim(args.iss);
validator.sub.set_optional_claim(args.sub);

Expand Down

0 comments on commit 59612b9

Please sign in to comment.