Skip to content

Commit

Permalink
Replace unwrap with expect
Browse files Browse the repository at this point in the history
  • Loading branch information
oteffahi committed Jul 22, 2024
1 parent 42a8c63 commit aa2c497
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions zenoh/src/net/routing/interceptor/authorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,15 @@ impl PolicyEnforcer {
entry_id
))?;
for subject_config_id in &entry.subjects {
let subject_combination_ids = subject_id_map.get(subject_config_id).unwrap();
let subject_combination_ids = subject_id_map
.get(subject_config_id)
.expect("config subject id should exist in subject_id_map");
for subject_id in subject_combination_ids {
for flow in rule.flows.as_ref().unwrap() {
for flow in rule
.flows
.as_ref()
.expect("flows list should be defined in rule")
{
for message in &rule.messages {
for key_expr in &rule.key_exprs {
policy_rules.push(PolicyRule {
Expand Down

0 comments on commit aa2c497

Please sign in to comment.