From 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 22 Feb 2025 23:01:54 +0000 Subject: update to rust edition 2024 --- azalea-brigadier/src/tree/mod.rs | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'azalea-brigadier/src/tree') 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 PartialEq for CommandNode { } } - 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 } -- cgit v1.2.3