From 4d88cfc78d5ed8996725440698e7d893e4ef7559 Mon Sep 17 00:00:00 2001 From: Hocuri Date: Thu, 13 Oct 2022 15:05:46 +0200 Subject: [PATCH] Don't use empty authserv id candidates if intersection is empty --- src/authres_handling.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/authres_handling.rs b/src/authres_handling.rs index 769a1af3e..99c050398 100644 --- a/src/authres_handling.rs +++ b/src/authres_handling.rs @@ -142,8 +142,9 @@ async fn update_authservid_candidates( let old_config = context.get_config(Config::AuthservidCandidates).await?; let old_ids = parse_authservid_candidates_config(&old_config); - if !old_ids.is_empty() { - new_ids = old_ids.intersection(&new_ids).copied().collect(); + let intersection: HashSet<&str> = old_ids.intersection(&new_ids).copied().collect(); + if !intersection.is_empty() { + new_ids = intersection; } // If there were no AuthservIdCandidates previously, just start with // the ones from the incoming email