File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
rust/rbac-registration/src/cardano/cip509/utils Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -73,12 +73,13 @@ impl Cip0134UriSet {
7373 & self . 0 . c_uris
7474 }
7575
76- /// Returns an iterator over of `Cip0134Uri`.
76+ /// Returns an iterator over of active (without taken) `Cip0134Uri`.
7777 pub ( crate ) fn values ( & self ) -> impl Iterator < Item = & Cip0134Uri > {
7878 self . x_uris ( )
7979 . values ( )
8080 . chain ( self . c_uris ( ) . values ( ) )
8181 . flat_map ( |uris| uris. iter ( ) )
82+ . filter ( |v| !self . 0 . taken_uris . contains ( v) )
8283 }
8384
8485 /// Returns `true` if both x509 and c509 certificate maps are empty.
@@ -224,12 +225,16 @@ impl Cip0134UriSet {
224225 #[ must_use]
225226 pub fn update_taken_uris (
226227 self ,
227- metadata : & Cip509RbacMetadata ,
228+ reg : & Cip509RbacMetadata ,
228229 ) -> Self {
229- let taken_uri_set = metadata. certificate_uris . values ( ) . collect :: < HashSet < _ > > ( ) ;
230230 let current_uris_set = self . values ( ) . collect :: < HashSet < _ > > ( ) ;
231- let latest_taken_uris = current_uris_set. intersection ( & taken_uri_set) ;
232- let latest_taken_uris = latest_taken_uris. cloned ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ;
231+
232+ let latest_taken_uris = reg
233+ . certificate_uris
234+ . values ( )
235+ . filter ( |v| current_uris_set. contains ( v) )
236+ . cloned ( )
237+ . collect :: < Vec < _ > > ( ) ;
233238
234239 let Cip0134UriSetInner {
235240 x_uris,
You can’t perform that action at this time.
0 commit comments