diff options
| author | mat <github@matdoes.dev> | 2022-04-18 15:18:54 +0000 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-18 15:18:54 +0000 |
| commit | d25c9926d714e1920a8656452f20cab60565443f (patch) | |
| tree | 172f556ffad34d6df96759d71cb3f16c2735d973 /azalea-brigadier/src/builder | |
| parent | b7d4b437dc9906d63b11f70cb03a5ca52ba6e5c5 (diff) | |
| download | azalea-drasl-d25c9926d714e1920a8656452f20cab60565443f.tar.xz | |
add get_path
Diffstat (limited to 'azalea-brigadier/src/builder')
| -rw-r--r-- | azalea-brigadier/src/builder/argument_builder.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/azalea-brigadier/src/builder/argument_builder.rs b/azalea-brigadier/src/builder/argument_builder.rs index 038b68a2..a5388a43 100644 --- a/azalea-brigadier/src/builder/argument_builder.rs +++ b/azalea-brigadier/src/builder/argument_builder.rs @@ -53,10 +53,12 @@ impl<S> ArgumentBuilder<S> { } } - // do we need to be cloning here? maybe we could return a ref to self? pub fn then(&mut self, argument: ArgumentBuilder<S>) -> Self { - self.arguments - .add_child(&Rc::new(RefCell::new(argument.build()))); + self.then_built(argument.build()) + } + + pub fn then_built(&mut self, argument: CommandNode<S>) -> Self { + self.arguments.add_child(&Rc::new(RefCell::new(argument))); self.clone() } |
