pub fn register_package(&self, package_metadata_name: &str) -> io::Result<()> {
        let packages = match (self.package_metadata(package_metadata_name)?, self.packages()?) {
            (PackageMetadata::V1 { package, .. }, Packages::V1 { packages }) => packages
                .into_iter()
                .filter(|p| p != &package)
                .chain(std::iter::once(package.clone()))
                .collect(),
        };
        let packages = Packages::V1 { packages };
        io::atomic_write_json(&self.dir.join(metadata::Versions::filename()), &packages)?;
        Ok(())
    }
/// Register or update package to repository
///
/// Fails if the atomic rename of `packages` fails.
Register or update package to repository
Fails if the atomic rename of `packages` fails.
Register or update package to repository Fails if the atomic rename of ` packages ` fails .
pub fn register_package(&self, package_metadata_name: &str) -> io::Result<()> {
        let packages = match (self.package_metadata(package_metadata_name)?, self.packages()?) {
            (PackageMetadata::V1 { package, .. }, Packages::V1 { packages }) => packages
                .into_iter()
                .filter(|p| p != &package)
                .chain(std::iter::once(package.clone()))
                .collect(),
        };
        let packages = Packages::V1 { packages };
        io::atomic_write_json(&self.dir.join(metadata::Versions::filename()), &packages)?;
        Ok(())
    }
pub fn register_package ( & self , package_metadata_name : & str ) -> io :: Result < ( ) > { let packages = match ( self . package_metadata ( package_metadata_name ) ? , self . packages ( ) ? ) { ( PackageMetadata :: V1 { package , .. } , Packages :: V1 { packages } ) => packages . into_iter ( ) . filter ( | p | p != & package ) . chain ( std :: iter :: once ( package . clone ( ) ) ) . collect ( ) , } ; let packages = Packages :: V1 { packages } ; io :: atomic_write_json ( & self . dir . join ( metadata :: Versions :: filename ( ) ) , & packages ) ? ; Ok ( ( ) ) }
Register or update package to repository
Fails if the atomic rename of `packages` fails.
Register or update package to repository Fails if the atomic rename of ` packages ` fails .
&self
package_metadata_name
&str
&self
package_metadata_name
&str