/// Construct a meta/package file in `gendir`.
///
/// Returns the path that the file was created at.
Construct a meta/package file in `gendir`.
Returns the path that the file was created at.
Construct a meta / package file in ` gendir ` . Returns the path that the file was created at .
fn create_meta_package_file(gendir: impl AsRef<Path>, name: impl Into<String>) -> Result<String> {
    let package_name = name.into();
    let meta_package_path = gendir.as_ref().join(META_PACKAGE_PATH);
    if let Some(parent_dir) = meta_package_path.parent() {
        std::fs::create_dir_all(parent_dir)?;
    }
    let file = std::fs::File::create(&meta_package_path)?;
    let meta_package = MetaPackage::from_name(package_name.try_into()?);
    meta_package.serialize(file)?;
    meta_package_path.path_to_string()
}
fn create_meta_package_file ( gendir : impl AsRef < Path > , name : impl Into < String > ) -> Result < String > { let package_name = name . into ( ) ; let meta_package_path = gendir . as_ref ( ) . join ( META_PACKAGE_PATH ) ; if let Some ( parent_dir ) = meta_package_path . parent ( ) { std :: fs :: create_dir_all ( parent_dir ) ? ; } let file = std :: fs :: File :: create ( & meta_package_path ) ? ; let meta_package = MetaPackage :: from_name ( package_name . try_into ( ) ? ) ; meta_package . serialize ( file ) ? ; meta_package_path . path_to_string ( ) }
Construct a meta/package file in `gendir`.
Construct a meta / package file in ` gendir ` .
gendir
impl AsRef<Path>
name
impl Into<String>