async fn populate_aliases(&self) -> Result<(), Error> {
        use librad::git::identities::SomeIdentity::Project;

        let storage = self.pool.get().await?;
        let read_only = &storage.read_only();
        let identities = identities::any::list(read_only)?;
        let mut map = self.aliases.write().unwrap();

        for identity in identities.flatten() {
            if let Project(project) = identity {
                let urn = Namespace::try_from(project.urn().encode_id().as_str()).unwrap();
                let name = (&project.payload().subject.name).to_string() + ".git";

                tracing::info!("alias {:?} for {:?}", name, urn.to_string());

                if let std::collections::hash_map::Entry::Vacant(e) = map.entry(name.clone()) {
                    e.insert(urn);
                } else {
                    tracing::warn!("alias {:?} exists, skipping", name);
                }
            }
        }

        Ok(())
    }
/// Populates alias map with unique projects' names and their urns
Populates alias map with unique projects' names and their urns
Populates alias map with unique projects ' names and their urns
async fn populate_aliases(&self) -> Result<(), Error> {
        use librad::git::identities::SomeIdentity::Project;
        let storage = self.pool.get().await?;
        let read_only = &storage.read_only();
        let identities = identities::any::list(read_only)?;
        let mut map = self.aliases.write().unwrap();
        for identity in identities.flatten() {
            if let Project(project) = identity {
                let urn = Namespace::try_from(project.urn().encode_id().as_str()).unwrap();
                let name = (&project.payload().subject.name).to_string() + ".git";
                tracing::info!("alias {:?} for {:?}", name, urn.to_string());
                if let std::collections::hash_map::Entry::Vacant(e) = map.entry(name.clone()) {
                    e.insert(urn);
                } else {
                    tracing::warn!("alias {:?} exists, skipping", name);
                }
            }
        }
        Ok(())
    }
async fn populate_aliases ( & self ) -> Result < ( ) , Error > { use librad :: git :: identities :: SomeIdentity :: Project ; let storage = self . pool . get ( ) . await ? ; let read_only = & storage . read_only ( ) ; let identities = identities :: any :: list ( read_only ) ? ; let mut map = self . aliases . write ( ) . unwrap ( ) ; for identity in identities . flatten ( ) { if let Project ( project ) = identity { let urn = Namespace :: try_from ( project . urn ( ) . encode_id ( ) . as_str ( ) ) . unwrap ( ) ; let name = ( & project . payload ( ) . subject . name ) . to_string ( ) + " " ; tracing :: info ! ( " " name urn to_string ( ) ) ; if let std :: collections :: hash_map :: Entry :: Vacant ( e ) = map . entry ( name . clone ( ) ) { e . insert ( urn ) ; } else { tracing :: warn ! ( " " name ) ; } } } Ok ( ( ) ) }
Populates alias map with unique projects' names and their urns
Populates alias map with unique projects ' names and their urns
&self
&self