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-inventory/src/slot.rs | |
| parent | a64c6505049082175224802c5be51ac8f0cf4677 (diff) | |
| download | azalea-drasl-ae4b1e85e669bc882d158509ef1eda46c6b2a72e.tar.xz | |
fix clippy issues and improve formatting everywhere
Diffstat (limited to 'azalea-inventory/src/slot.rs')
| -rw-r--r-- | azalea-inventory/src/slot.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/azalea-inventory/src/slot.rs b/azalea-inventory/src/slot.rs index e2e84a68..c48d9488 100644 --- a/azalea-inventory/src/slot.rs +++ b/azalea-inventory/src/slot.rs @@ -1,7 +1,7 @@ use std::{ any::Any, fmt, - io::{Cursor, Write}, + io::{self, Cursor, Write}, }; use azalea_buf::{AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; @@ -73,10 +73,10 @@ impl ItemStack { /// Update whether this slot is empty, based on the count. pub fn update_empty(&mut self) { - if let ItemStack::Present(i) = self { - if i.is_empty() { - *self = ItemStack::Empty; - } + if let ItemStack::Present(i) = self + && i.is_empty() + { + *self = ItemStack::Empty; } } @@ -159,7 +159,7 @@ impl AzaleaRead for ItemStack { } impl AzaleaWrite for ItemStack { - fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { match self { ItemStack::Empty => 0_i32.azalea_write_var(buf)?, ItemStack::Present(i) => { @@ -256,7 +256,7 @@ impl AzaleaRead for DataComponentPatch { } impl AzaleaWrite for DataComponentPatch { - fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { let mut components_with_data_count: u32 = 0; let mut components_without_data_count: u32 = 0; for component in self.components.values() { |
