diff options
| author | mat <git@matdoes.dev> | 2025-05-30 19:36:59 -0800 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-05-30 19:36:59 -0800 |
| commit | ae4b1e85e669bc882d158509ef1eda46c6b2a72e (patch) | |
| tree | adf81cc01b0ce1575e95b99ad109fd92db1738f6 /azalea-world/src | |
| parent | a64c6505049082175224802c5be51ac8f0cf4677 (diff) | |
| download | azalea-drasl-ae4b1e85e669bc882d158509ef1eda46c6b2a72e.tar.xz | |
fix clippy issues and improve formatting everywhere
Diffstat (limited to 'azalea-world/src')
| -rw-r--r-- | azalea-world/src/chunk_storage.rs | 7 | ||||
| -rw-r--r-- | azalea-world/src/heightmap.rs | 7 | ||||
| -rw-r--r-- | azalea-world/src/palette.rs | 6 | ||||
| -rw-r--r-- | azalea-world/src/world.rs | 14 |
4 files changed, 19 insertions, 15 deletions
diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs index 9e97a7a7..b3ccbe3a 100644 --- a/azalea-world/src/chunk_storage.rs +++ b/azalea-world/src/chunk_storage.rs @@ -5,6 +5,7 @@ use std::{ io::{Cursor, Write}, sync::{Arc, Weak}, }; +use std::{fmt, io}; use azalea_block::block_state::{BlockState, BlockStateIntegerRepr}; use azalea_block::fluid_state::FluidState; @@ -414,7 +415,7 @@ pub fn get_block_state_from_sections( } impl AzaleaWrite for Chunk { - fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { for section in &self.sections { section.azalea_write(buf)?; } @@ -423,7 +424,7 @@ impl AzaleaWrite for Chunk { } impl Debug for PartialChunkStorage { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("PartialChunkStorage") .field("view_center", &self.view_center) .field("chunk_radius", &self.chunk_radius) @@ -466,7 +467,7 @@ impl AzaleaRead for Section { } impl AzaleaWrite for Section { - fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { self.block_count.azalea_write(buf)?; self.states.azalea_write(buf)?; self.biomes.azalea_write(buf)?; diff --git a/azalea-world/src/heightmap.rs b/azalea-world/src/heightmap.rs index 00ebad41..462d5b09 100644 --- a/azalea-world/src/heightmap.rs +++ b/azalea-world/src/heightmap.rs @@ -1,4 +1,7 @@ -use std::{fmt::Display, str::FromStr}; +use std::{ + fmt::{self, Display}, + str::FromStr, +}; use azalea_block::BlockState; use azalea_buf::AzBuf; @@ -161,7 +164,7 @@ impl FromStr for HeightmapKind { } impl Display for HeightmapKind { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { HeightmapKind::WorldSurfaceWg => write!(f, "WORLD_SURFACE_WG"), HeightmapKind::WorldSurface => write!(f, "WORLD_SURFACE"), diff --git a/azalea-world/src/palette.rs b/azalea-world/src/palette.rs index 37d43fac..cef9bdee 100644 --- a/azalea-world/src/palette.rs +++ b/azalea-world/src/palette.rs @@ -1,4 +1,4 @@ -use std::io::{Cursor, Write}; +use std::io::{self, Cursor, Write}; use azalea_block::BlockState; use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; @@ -232,7 +232,7 @@ impl PalettedContainer { } impl AzaleaWrite for PalettedContainer { - fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { self.bits_per_entry.azalea_write(buf)?; self.palette.azalea_write(buf)?; self.storage.data.azalea_write(buf)?; @@ -272,7 +272,7 @@ impl Palette { } impl AzaleaWrite for Palette { - fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { match self { Palette::SingleValue(value) => { value.azalea_write(buf)?; diff --git a/azalea-world/src/world.rs b/azalea-world/src/world.rs index 4b2b2a19..9a734ab1 100644 --- a/azalea-world/src/world.rs +++ b/azalea-world/src/world.rs @@ -1,9 +1,9 @@ -use std::fmt::{self, Display, Formatter}; -use std::hash::{Hash, Hasher}; -use std::io::{self, Cursor}; use std::{ collections::{HashMap, HashSet}, fmt::Debug, + fmt::{self, Display}, + hash::{Hash, Hasher}, + io::{self, Cursor}, }; use azalea_block::BlockState; @@ -84,7 +84,7 @@ impl AzaleaRead for MinecraftEntityId { } } impl AzaleaWrite for MinecraftEntityId { - fn azalea_write(&self, buf: &mut impl io::Write) -> Result<(), io::Error> { + fn azalea_write(&self, buf: &mut impl io::Write) -> io::Result<()> { i32::azalea_write(&self.0, buf) } } @@ -94,12 +94,12 @@ impl AzaleaReadVar for MinecraftEntityId { } } impl AzaleaWriteVar for MinecraftEntityId { - fn azalea_write_var(&self, buf: &mut impl io::Write) -> Result<(), io::Error> { + fn azalea_write_var(&self, buf: &mut impl io::Write) -> io::Result<()> { i32::azalea_write_var(&self.0, buf) } } impl Display for MinecraftEntityId { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "eid({})", self.0) } } @@ -176,7 +176,7 @@ impl Instance { } impl Debug for PartialInstance { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("PartialInstance") .field("chunks", &self.chunks) .field("entity_infos", &self.entity_infos) |
