From ee2575794e91b9457a74a95daf1dcc707058cd58 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 12 Oct 2025 23:01:54 +0300 Subject: upgrade deps and clean up lots of doc comments --- azalea-brigadier/src/tree/mod.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'azalea-brigadier/src/tree') diff --git a/azalea-brigadier/src/tree/mod.rs b/azalea-brigadier/src/tree/mod.rs index 993b0698..12a5a50c 100644 --- a/azalea-brigadier/src/tree/mod.rs +++ b/azalea-brigadier/src/tree/mod.rs @@ -57,16 +57,26 @@ impl Clone for CommandNode { } impl CommandNode { - /// Gets the literal, or panics. You should use match if you're not certain - /// about the type. + /// Returns the value as a literal from this command node, assuming it's + /// already been checked. + /// + /// # Panics + /// + /// Will panic if this node is not a literal. Consider using a match + /// statement instead. pub fn literal(&self) -> &Literal { match self.value { ArgumentBuilderType::Literal(ref literal) => literal, _ => panic!("CommandNode::literal() called on non-literal node"), } } - /// Gets the argument, or panics. You should use match if you're not certain - /// about the type. + /// Returns the value as an argument from this command node, assuming it's + /// already been checked. + /// + /// # Panics + /// + /// Will panic if this node is not an argument. Consider using a match + /// statement instead. pub fn argument(&self) -> &Argument { match self.value { ArgumentBuilderType::Argument(ref argument) => argument, -- cgit v1.2.3