pub fn export_each(config: &crate::cli::Config) -> CacheResult<()> {
    let folder = path!(&config.output / "location_configs");
    fs::create_dir_all(&folder)?;

    let configs = LocationConfig::dump_all(config)?;
    configs.into_iter().par_bridge().for_each(|(id, location_config)| {
        let mut file = File::create(path!(&folder / f!("{id}.json"))).unwrap();

        let data = serde_json::to_string_pretty(&location_config).unwrap();
        file.write_all(data.as_bytes()).unwrap();
    });

    Ok(())
}
///Save the location configs as individual `json` files.
Save the location configs as individual `json` files.
Save the location configs as individual ` json ` files .
pub fn export_each(config: &crate::cli::Config) -> CacheResult<()> {
    let folder = path!(&config.output / "location_configs");
    fs::create_dir_all(&folder)?;
    let configs = LocationConfig::dump_all(config)?;
    configs.into_iter().par_bridge().for_each(|(id, location_config)| {
        let mut file = File::create(path!(&folder / f!("{id}.json"))).unwrap();
        let data = serde_json::to_string_pretty(&location_config).unwrap();
        file.write_all(data.as_bytes()).unwrap();
    });
    Ok(())
}
pub fn export_each ( config : & crate :: cli :: Config ) -> CacheResult < ( ) > { let folder = path ! ( config output " " ) ; fs :: create_dir_all ( & folder ) ? ; let configs = LocationConfig :: dump_all ( config ) ? ; configs . into_iter ( ) . par_bridge ( ) . for_each ( | ( id , location_config ) | { let mut file = File :: create ( path ! ( folder f ( " " ) ) ) . unwrap ( ) ; let data = serde_json :: to_string_pretty ( & location_config ) . unwrap ( ) ; file . write_all ( data . as_bytes ( ) ) . unwrap ( ) ; } ) ; Ok ( ( ) ) }
Save the location configs as individual `json` files.
Save the location configs as individual ` json ` files .
config
&crate::cli::Config
config
&crate::cli::Config