minedmap: store region list in BTreeSet

We want to have a sorted list in the end anyways to make metadata
generation deterministic, and we don't have to worry about deduplication
of coordinates when generating mipmap tile lists.
This commit is contained in:
Matthias Schiffer 2023-07-02 18:16:35 +02:00
parent e5c96ecb99
commit b53d34da3d
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
3 changed files with 7 additions and 7 deletions

View file

@ -80,10 +80,10 @@ impl<'a> TileRenderer<'a> {
})
}
pub fn run(self, regions: &[TileCoords]) -> Result<()> {
pub fn run(self, regions: impl IntoIterator<Item = TileCoords>) -> Result<()> {
fs::create_dir_all(&self.config.map_dir)?;
for &coords in regions {
for coords in regions {
if let Err(err) = self.render_tile(coords) {
eprintln!("Failed to render tile {:?}: {:?}", coords, err,);
}