mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
Format let-else blocks
Use nightly rustfmt to format let-else.
This commit is contained in:
parent
ab3b273992
commit
7d231b92ea
3 changed files with 18 additions and 5 deletions
|
@ -20,8 +20,8 @@ fn parse_region_filename(path: &Path) -> Option<TileCoords> {
|
||||||
let file_name = path.file_name()?.to_str()?;
|
let file_name = path.file_name()?.to_str()?;
|
||||||
let parts: Vec<_> = file_name.split('.').collect();
|
let parts: Vec<_> = file_name.split('.').collect();
|
||||||
let &["r", x, z, "mca"] = parts.as_slice() else {
|
let &["r", x, z, "mca"] = parts.as_slice() else {
|
||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
|
|
||||||
Some(TileCoords {
|
Some(TileCoords {
|
||||||
x: x.parse().ok()?,
|
x: x.parse().ok()?,
|
||||||
|
@ -114,7 +114,12 @@ impl<'a> RegionProcessor<'a> {
|
||||||
|
|
||||||
minedmap::io::region::from_file(path)?.foreach_chunk(
|
minedmap::io::region::from_file(path)?.foreach_chunk(
|
||||||
|chunk_coords, data: world::de::Chunk| {
|
|chunk_coords, data: world::de::Chunk| {
|
||||||
let Some(layer::LayerData{ blocks, biomes, block_light, depths }) = self
|
let Some(layer::LayerData {
|
||||||
|
blocks,
|
||||||
|
biomes,
|
||||||
|
block_light,
|
||||||
|
depths,
|
||||||
|
}) = self
|
||||||
.process_chunk(&mut processed_region.biome_list, data)
|
.process_chunk(&mut processed_region.biome_list, data)
|
||||||
.with_context(|| format!("Failed to process chunk {:?}", chunk_coords))?
|
.with_context(|| format!("Failed to process chunk {:?}", chunk_coords))?
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -107,7 +107,13 @@ impl<'a> TileRenderer<'a> {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let Some(biome) = biome_at(region_group, chunk_coords, block_coords, dx as i32, dz as i32) else {
|
let Some(biome) = biome_at(
|
||||||
|
region_group,
|
||||||
|
chunk_coords,
|
||||||
|
block_coords,
|
||||||
|
dx as i32,
|
||||||
|
dz as i32,
|
||||||
|
) else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,9 @@ impl<'a> LayerEntry<'a> {
|
||||||
section: SectionIterItem,
|
section: SectionIterItem,
|
||||||
coords: SectionBlockCoords,
|
coords: SectionBlockCoords,
|
||||||
) -> Result<bool> {
|
) -> Result<bool> {
|
||||||
let Some(block_type) = section.section.block_at(coords)?
|
let Some(block_type) = section
|
||||||
|
.section
|
||||||
|
.block_at(coords)?
|
||||||
.filter(|block_type| block_type.is(BlockFlag::Opaque))
|
.filter(|block_type| block_type.is(BlockFlag::Opaque))
|
||||||
else {
|
else {
|
||||||
if self.is_empty() {
|
if self.is_empty() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue