io/storage: add JSON support

Bincode can't deal with a number of serde's features that would be
desirable if we're using the same Serialize impls for generating JSON
data for the viewer.
This commit is contained in:
Matthias Schiffer 2023-11-26 14:12:51 +01:00
parent 5d40d061a4
commit c44f6ab859
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
3 changed files with 30 additions and 8 deletions

View file

@ -148,6 +148,7 @@ impl<'a> SingleRegionProcessor<'a> {
storage::write_file(
&self.output_path,
&self.processed_region,
storage::Format::Bincode,
REGION_FILE_META_VERSION,
self.input_timestamp,
)

View file

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