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/components.rs | |
| parent | a64c6505049082175224802c5be51ac8f0cf4677 (diff) | |
| download | azalea-drasl-ae4b1e85e669bc882d158509ef1eda46c6b2a72e.tar.xz | |
fix clippy issues and improve formatting everywhere
Diffstat (limited to 'azalea-inventory/src/components.rs')
| -rw-r--r-- | azalea-inventory/src/components.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/azalea-inventory/src/components.rs b/azalea-inventory/src/components.rs index 9e0a37b0..72216475 100644 --- a/azalea-inventory/src/components.rs +++ b/azalea-inventory/src/components.rs @@ -1,5 +1,9 @@ use core::f64; -use std::{any::Any, collections::HashMap, io::Cursor}; +use std::{ + any::Any, + collections::HashMap, + io::{self, Cursor}, +}; use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError}; use azalea_chat::FormattedText; @@ -23,11 +27,11 @@ pub trait DataComponent: Send + Sync + Any { } pub trait EncodableDataComponent: Send + Sync + Any { - fn encode(&self, buf: &mut Vec<u8>) -> Result<(), std::io::Error>; + fn encode(&self, buf: &mut Vec<u8>) -> io::Result<()>; // using the Clone trait makes it not be object-safe, so we have our own clone // function instead fn clone(&self) -> Box<dyn EncodableDataComponent>; - // same deal here + // same thing here fn eq(&self, other: Box<dyn EncodableDataComponent>) -> bool; } @@ -35,7 +39,7 @@ impl<T> EncodableDataComponent for T where T: DataComponent + Clone + AzaleaWrite + AzaleaRead + PartialEq, { - fn encode(&self, buf: &mut Vec<u8>) -> Result<(), std::io::Error> { + fn encode(&self, buf: &mut Vec<u8>) -> io::Result<()> { self.azalea_write(buf) } fn clone(&self) -> Box<dyn EncodableDataComponent> { |
