io/storage: split out inner part of read/write

Allow reusing the read/write logic without requiring control over the file
open.
This commit is contained in:
Matthias Schiffer 2023-11-26 12:47:31 +01:00
parent f0e0db63d3
commit 5d40d061a4
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
3 changed files with 31 additions and 24 deletions

View file

@ -145,7 +145,7 @@ impl<'a> SingleRegionProcessor<'a> {
return Ok(());
}
storage::write(
storage::write_file(
&self.output_path,
&self.processed_region,
REGION_FILE_META_VERSION,

View file

@ -105,7 +105,7 @@ impl<'a> TileRenderer<'a> {
region_loader
.get_or_try_init(|| async {
storage::read(&processed_path).context("Failed to load processed region data")
storage::read_file(&processed_path).context("Failed to load processed region data")
})
.await
.cloned()