From aa2c4971d616a284ffc8d9f9f2715681af507b03 Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Mon, 22 Jul 2024 17:45:30 +0200 Subject: [PATCH] Replace unwrap with expect --- zenoh/src/net/routing/interceptor/authorization.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zenoh/src/net/routing/interceptor/authorization.rs b/zenoh/src/net/routing/interceptor/authorization.rs index 651dc66021..0056129915 100644 --- a/zenoh/src/net/routing/interceptor/authorization.rs +++ b/zenoh/src/net/routing/interceptor/authorization.rs @@ -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 {