diff options
| author | mat <git@matdoes.dev> | 2025-02-22 23:01:54 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-02-22 23:01:54 +0000 |
| commit | 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (patch) | |
| tree | 7920fec1203e8e96463a142f5f6da6164e76e684 /azalea-brigadier/src/tree | |
| parent | bdd2fc91e11e2896d8e1c7046df247e1075bd40d (diff) | |
| download | azalea-drasl-34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6.tar.xz | |
update to rust edition 2024
Diffstat (limited to 'azalea-brigadier/src/tree')
| -rwxr-xr-x | azalea-brigadier/src/tree/mod.rs | 27 |
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 } |
