pub fn export_locations_by_square(config: &crate::cli::Config) -> CacheResult<()> {
    let out = path_macro::path!(config.output / "locations");

    fs::create_dir_all(&out)?;
    MapSquares::new(config)?.into_iter().par_bridge().for_each(|sq| {
        let sq = sq.expect("error deserializing mapsquare");
        let i = sq.i;
        let j = sq.j;
        if let Ok(locations) = sq.take_locations() {
            if !locations.is_empty() {
                let mut file = File::create(path!(&out / f!("{i}_{j}.json"))).unwrap();
                let data = serde_json::to_string_pretty(&locations).unwrap();
                file.write_all(data.as_bytes()).unwrap();
            }
        }
    });

    Ok(())
}
/// Saves all occurences of every object id as a `json` file to the folder `out/data/rs3/locations`.
Saves all occurences of every object id as a `json` file to the folder `out/data/rs3/locations`.
Saves all occurences of every object id as a ` json ` file to the folder ` out / data / rs3 / locations ` .
pub fn export_locations_by_square(config: &crate::cli::Config) -> CacheResult<()> {
    let out = path_macro::path!(config.output / "locations");
    fs::create_dir_all(&out)?;
    MapSquares::new(config)?.into_iter().par_bridge().for_each(|sq| {
        let sq = sq.expect("error deserializing mapsquare");
        let i = sq.i;
        let j = sq.j;
        if let Ok(locations) = sq.take_locations() {
            if !locations.is_empty() {
                let mut file = File::create(path!(&out / f!("{i}_{j}.json"))).unwrap();
                let data = serde_json::to_string_pretty(&locations).unwrap();
                file.write_all(data.as_bytes()).unwrap();
            }
        }
    });
    Ok(())
}
pub fn export_locations_by_square ( config : & crate :: cli :: Config ) -> CacheResult < ( ) > { let out = path_macro :: path ! ( config output " " ) ; fs :: create_dir_all ( & out ) ? ; MapSquares :: new ( config ) ? . into_iter ( ) . par_bridge ( ) . for_each ( | sq | { let sq = sq . expect ( " " ) ; let i = sq . i ; let j = sq . j ; if let Ok ( locations ) = sq . take_locations ( ) { if ! locations . is_empty ( ) { let mut file = File :: create ( path ! ( out f ( " " ) ) ) . unwrap ( ) ; let data = serde_json :: to_string_pretty ( & locations ) . unwrap ( ) ; file . write_all ( data . as_bytes ( ) ) . unwrap ( ) ; } } } ) ; Ok ( ( ) ) }
Saves all occurences of every object id as a `json` file to the folder `out/data/rs3/locations`.
Saves all occurences of every object id as a ` json ` file to the folder ` out / data / rs3 / locations ` .
config
&crate::cli::Config
config
&crate::cli::Config