diff options
| author | mat <git@matdoes.dev> | 2025-09-20 20:35:16 -1200 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-09-20 20:35:16 -1200 |
| commit | 585b51e91a5335eae37bc5af7c0111bb2092b156 (patch) | |
| tree | c1559014df9db20dd625d9fe972d4e9f88317008 /azalea-inventory/src | |
| parent | db793448ff8e656ad80859835edc3b89cb547dd2 (diff) | |
| download | azalea-drasl-585b51e91a5335eae37bc5af7c0111bb2092b156.tar.xz | |
more accurate mining and impl PartialEq for packets
Diffstat (limited to 'azalea-inventory/src')
| -rw-r--r-- | azalea-inventory/src/components.rs | 6 | ||||
| -rw-r--r-- | azalea-inventory/src/operations.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/azalea-inventory/src/components.rs b/azalea-inventory/src/components.rs index f63ca1ad..ad15a461 100644 --- a/azalea-inventory/src/components.rs +++ b/azalea-inventory/src/components.rs @@ -41,7 +41,7 @@ pub trait EncodableDataComponent: Send + Sync + Any { // function instead fn clone(&self) -> Box<dyn EncodableDataComponent>; // same thing here - fn eq(&self, other: Box<dyn EncodableDataComponent>) -> bool; + fn eq(&self, other: &dyn EncodableDataComponent) -> bool; } impl<T> EncodableDataComponent for T @@ -58,8 +58,8 @@ where let cloned = self.clone(); Box::new(cloned) } - fn eq(&self, other: Box<dyn EncodableDataComponent>) -> bool { - let other_any: Box<dyn Any> = other; + fn eq(&self, other: &dyn EncodableDataComponent) -> bool { + let other_any: &dyn Any = other; match other_any.downcast_ref::<T>() { Some(other) => self == other, _ => false, diff --git a/azalea-inventory/src/operations.rs b/azalea-inventory/src/operations.rs index 60bf9e64..97ae1e60 100644 --- a/azalea-inventory/src/operations.rs +++ b/azalea-inventory/src/operations.rs @@ -253,7 +253,7 @@ impl ClickOperation { } } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum ClickType { Pickup = 0, QuickMove = 1, |
