aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/tree
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-brigadier/src/tree')
-rwxr-xr-xazalea-brigadier/src/tree/mod.rs27
1 files changed, 18 insertions, 9 deletions
diff --git a/azalea-brigadier/src/tree/mod.rs b/azalea-brigadier/src/tree/mod.rs
index dfa3b375..690e5df3 100755
--- a/azalea-brigadier/src/tree/mod.rs
+++ b/azalea-brigadier/src/tree/mod.rs
@@ -292,18 +292,27 @@ impl<S> PartialEq for CommandNode<S> {
}
}
- if let Some(selfexecutes) = &self.command {
- // idk how to do this better since we can't compare `dyn Fn`s
- if let Some(otherexecutes) = &other.command {
- #[allow(ambiguous_wide_pointer_comparisons)]
- if !Arc::ptr_eq(selfexecutes, otherexecutes) {
+ match &self.command {
+ Some(selfexecutes) => {
+ // idk how to do this better since we can't compare `dyn Fn`s
+ match &other.command {
+ Some(otherexecutes) =>
+ {
+ #[allow(ambiguous_wide_pointer_comparisons)]
+ if !Arc::ptr_eq(selfexecutes, otherexecutes) {
+ return false;
+ }
+ }
+ _ => {
+ return false;
+ }
+ }
+ }
+ _ => {
+ if other.command.is_some() {
return false;
}
- } else {
- return false;
}
- } else if other.command.is_some() {
- return false;
}
true
}