File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,16 +173,15 @@ impl DefaultRoleManager {
173173 // return the list of affected domain names (immutable) to avoid nested
174174 // mutable borrows when performing operations across domains
175175 fn affected_domain_names ( & self , domain : & str ) -> Vec < String > {
176- let mut res = Vec :: new ( ) ;
177- if let Some ( domain_matching_fn ) = self . domain_matching_fn {
178- let keys : Vec < String > = self . all_domains . keys ( ) . cloned ( ) . collect ( ) ;
179- for d in keys {
180- if d != domain && ( domain_matching_fn ) ( & d , domain ) {
181- res . push ( d ) ;
182- }
183- }
176+ if let Some ( matcher ) = self . domain_matching_fn {
177+ self . all_domains
178+ . keys ( )
179+ . filter ( |d| * d != domain && matcher ( d , domain ) )
180+ . cloned ( )
181+ . collect ( )
182+ } else {
183+ Vec :: new ( )
184184 }
185- res
186185 }
187186
188187 // copy all role links and nodes from `src_domain` graph into `dst_domain` graph
You can’t perform that action at this time.
0 commit comments