world/section: prefer slice references to Vec and fastnbt types

Makes the code a bit nicer and saves repeated deref calls into fastnbt.
This commit is contained in:
Matthias Schiffer 2023-03-04 00:27:26 +01:00
parent a4b726992a
commit 56573640fd
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
2 changed files with 11 additions and 15 deletions

View file

@ -92,12 +92,12 @@ impl<'a> Chunk<'a> {
(
SectionV1_13::new(
data_version,
section.block_states.data.as_ref(),
section.block_states.data.as_deref(),
&section.block_states.palette,
block_types,
)
.with_context(|| format!("Failed to load section at Y={}", section.y))?,
BiomesV18::new(section.biomes.data.as_ref(), &section.biomes.palette)
BiomesV18::new(section.biomes.data.as_deref(), &section.biomes.palette)
.with_context(|| {
format!("Failed to load section biomes at Y={}", section.y)
})?,