aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/context/command_context_builder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-brigadier/src/context/command_context_builder.rs')
-rwxr-xr-xazalea-brigadier/src/context/command_context_builder.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/azalea-brigadier/src/context/command_context_builder.rs b/azalea-brigadier/src/context/command_context_builder.rs
index 54063879..78088941 100755
--- a/azalea-brigadier/src/context/command_context_builder.rs
+++ b/azalea-brigadier/src/context/command_context_builder.rs
@@ -9,18 +9,18 @@ use crate::{
modifier::RedirectModifier,
tree::{Command, CommandNode},
};
-use std::{collections::HashMap, fmt::Debug, rc::Rc, sync::Arc};
+use std::{collections::HashMap, fmt::Debug, sync::Arc};
pub struct CommandContextBuilder<'a, S> {
pub arguments: HashMap<String, ParsedArgument>,
pub root: Arc<RwLock<CommandNode<S>>>,
pub nodes: Vec<ParsedCommandNode<S>>,
pub dispatcher: &'a CommandDispatcher<S>,
- pub source: Rc<S>,
+ pub source: Arc<S>,
pub command: Command<S>,
- pub child: Option<Rc<CommandContextBuilder<'a, S>>>,
+ pub child: Option<Arc<CommandContextBuilder<'a, S>>>,
pub range: StringRange,
- pub modifier: Option<Rc<RedirectModifier<S>>>,
+ pub modifier: Option<Arc<RedirectModifier<S>>>,
pub forks: bool,
}
@@ -44,7 +44,7 @@ impl<S> Clone for CommandContextBuilder<'_, S> {
impl<'a, S> CommandContextBuilder<'a, S> {
pub fn new(
dispatcher: &'a CommandDispatcher<S>,
- source: Rc<S>,
+ source: Arc<S>,
root_node: Arc<RwLock<CommandNode<S>>>,
start: usize,
) -> Self {
@@ -66,7 +66,7 @@ impl<'a, S> CommandContextBuilder<'a, S> {
self.command = command.clone();
self
}
- pub fn with_child(&mut self, child: Rc<CommandContextBuilder<'a, S>>) -> &Self {
+ pub fn with_child(&mut self, child: Arc<CommandContextBuilder<'a, S>>) -> &Self {
self.child = Some(child);
self
}
@@ -92,7 +92,7 @@ impl<'a, S> CommandContextBuilder<'a, S> {
nodes: self.nodes.clone(),
source: self.source.clone(),
command: self.command.clone(),
- child: self.child.clone().map(|c| Rc::new(c.build(input))),
+ child: self.child.clone().map(|c| Arc::new(c.build(input))),
range: self.range.clone(),
forks: self.forks,
modifier: self.modifier.clone(),