diff options
| author | mat <github@matdoes.dev> | 2022-06-25 02:33:28 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-25 02:33:28 -0500 |
| commit | cd9a05e5a62190b3d4a2a733bf637d6324aec5fd (patch) | |
| tree | 15fb360678dfb5e8d81330144b810735b73f6ef4 /azalea-world/src | |
| parent | c9faf25fab4f89319731fec87ad4d2cf45864632 (diff) | |
| download | azalea-drasl-cd9a05e5a62190b3d4a2a733bf637d6324aec5fd.tar.xz | |
read_into -> read_from
yeah
Diffstat (limited to 'azalea-world/src')
| -rw-r--r-- | azalea-world/src/chunk.rs | 6 | ||||
| -rw-r--r-- | azalea-world/src/palette.rs | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/azalea-world/src/chunk.rs b/azalea-world/src/chunk.rs index 27ef1ca7..a19ece8c 100644 --- a/azalea-world/src/chunk.rs +++ b/azalea-world/src/chunk.rs @@ -117,7 +117,7 @@ impl Chunk { let section_count = world_height / SECTION_HEIGHT; let mut sections = Vec::with_capacity(section_count as usize); for _ in 0..section_count { - let section = Section::read_into(buf)?; + let section = Section::read_from(buf)?; sections.push(section); } Ok(Chunk { sections }) @@ -171,8 +171,8 @@ pub struct Section { } impl McBufReadable for Section { - fn read_into(buf: &mut impl Read) -> Result<Self, String> { - let block_count = u16::read_into(buf)?; + fn read_from(buf: &mut impl Read) -> Result<Self, String> { + let block_count = u16::read_from(buf)?; // this is commented out because the vanilla server is wrong // assert!( diff --git a/azalea-world/src/palette.rs b/azalea-world/src/palette.rs index 4779dc4b..1b40f257 100644 --- a/azalea-world/src/palette.rs +++ b/azalea-world/src/palette.rs @@ -37,7 +37,7 @@ impl PalettedContainer { PalettedContainerType::Biomes => 64, }; - let data = Vec::<u64>::read_into(buf)?; + let data = Vec::<u64>::read_from(buf)?; debug_assert!( bits_per_entry != 0 || data.is_empty(), "Bits per entry is 0 but data is not empty." @@ -92,9 +92,9 @@ impl Palette { bits_per_entry: u8, ) -> Result<Palette, String> { Ok(match bits_per_entry { - 0 => Palette::SingleValue(u32::var_read_into(buf)?), - 1..=4 => Palette::Linear(Vec::<u32>::var_read_into(buf)?), - 5..=8 => Palette::Hashmap(Vec::<u32>::var_read_into(buf)?), + 0 => Palette::SingleValue(u32::var_read_from(buf)?), + 1..=4 => Palette::Linear(Vec::<u32>::var_read_from(buf)?), + 5..=8 => Palette::Hashmap(Vec::<u32>::var_read_from(buf)?), _ => Palette::Global, }) } @@ -104,8 +104,8 @@ impl Palette { bits_per_entry: u8, ) -> Result<Palette, String> { Ok(match bits_per_entry { - 0 => Palette::SingleValue(u32::var_read_into(buf)?), - 1..=3 => Palette::Linear(Vec::<u32>::var_read_into(buf)?), + 0 => Palette::SingleValue(u32::var_read_from(buf)?), + 1..=3 => Palette::Linear(Vec::<u32>::var_read_from(buf)?), _ => Palette::Global, }) } |
