aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/tree
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-02-22 23:01:54 +0000
committermat <git@matdoes.dev>2025-02-22 23:01:54 +0000
commit34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (patch)
tree7920fec1203e8e96463a142f5f6da6164e76e684 /azalea-brigadier/src/tree
parentbdd2fc91e11e2896d8e1c7046df247e1075bd40d (diff)
downloadazalea-drasl-34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6.tar.xz
update to rust edition 2024
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
}