pub fn extract_access_rights_from_keys<I: IntoIterator<Item = Key>>(
    input: I,
) -> HashMap<Address, HashSet<AccessRights>> {
    input
        .into_iter()
        .map(key_to_tuple)
        .flatten()
        .group_by(|(key, _)| *key)
        .into_iter()
        .map(|(key, group)| {
            (
                key,
                group.map(|(_, x)| x).collect::<HashSet<AccessRights>>(),
            )
        })
        .collect()
}
/// Groups a collection of keys by their address and accumulates access rights
/// per key.
Groups a collection of keys by their address and accumulates access rights
per key.
Groups a collection of keys by their address and accumulates access rights per key .
pub fn extract_access_rights_from_keys<I: IntoIterator<Item = Key>>(
    input: I,
) -> HashMap<Address, HashSet<AccessRights>> {
    input
        .into_iter()
        .map(key_to_tuple)
        .flatten()
        .group_by(|(key, _)| *key)
        .into_iter()
        .map(|(key, group)| {
            (
                key,
                group.map(|(_, x)| x).collect::<HashSet<AccessRights>>(),
            )
        })
        .collect()
}
pub fn extract_access_rights_from_keys < I : IntoIterator < Item = Key > > ( input : I , ) -> HashMap < Address , HashSet < AccessRights > > { input . into_iter ( ) . map ( key_to_tuple ) . flatten ( ) . group_by ( | ( key , _ ) | * key ) . into_iter ( ) . map ( | ( key , group ) | { ( key , group . map ( | ( _ , x ) | x ) . collect :: < HashSet < AccessRights > > ( ) , ) } ) . collect ( ) }
Groups a collection of keys by their address and accumulates access rights
per key.
Groups a collection of keys by their address and accumulates access rights per key .
input
I
input
I