diff options
| -rw-r--r-- | azalea-brigadier/src/context/command_context_builder.rs | 7 | ||||
| -rw-r--r-- | azalea-brigadier/src/tree/command_node.rs | 8 |
2 files changed, 6 insertions, 9 deletions
diff --git a/azalea-brigadier/src/context/command_context_builder.rs b/azalea-brigadier/src/context/command_context_builder.rs index 969f9cfd..ba25849c 100644 --- a/azalea-brigadier/src/context/command_context_builder.rs +++ b/azalea-brigadier/src/context/command_context_builder.rs @@ -45,14 +45,11 @@ pub struct CommandContextBuilder<'a, S> { // this.range = StringRange.at(start); // } -impl<S> CommandContextBuilder<'_, S> -where - , -{ +impl<S> CommandContextBuilder<'_, S> { pub fn new( dispatcher: CommandDispatcher<S>, source: S, - root_node: dyn CommandNodeTrait<S>, + root_node: &dyn CommandNodeTrait<S>, start: usize, ) -> Self { Self { diff --git a/azalea-brigadier/src/tree/command_node.rs b/azalea-brigadier/src/tree/command_node.rs index b7801363..30907163 100644 --- a/azalea-brigadier/src/tree/command_node.rs +++ b/azalea-brigadier/src/tree/command_node.rs @@ -21,14 +21,14 @@ enum CommandNodeEnum<'a, S> { Root(RootCommandNode<'a, S>), } -impl<S> Deref for CommandNodeEnum<'_, S> { +impl<'a, S> Deref for CommandNodeEnum<'a, S> { type Target = dyn CommandNodeTrait<S>; fn deref(&self) -> &Self::Target { match self { - CommandNodeEnum::Literal(node) => node, - CommandNodeEnum::Argument(node) => node, - CommandNodeEnum::Root(node) => node, + CommandNodeEnum::Literal(node) => *node as &Self::Target, + CommandNodeEnum::Argument(node) => *node as &Self::Target, + CommandNodeEnum::Root(node) => *node as &Self::Target, } } } |
