aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/context/command_context.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-05-05 23:23:11 -0500
committermat <git@matdoes.dev>2023-05-05 23:23:11 -0500
commitf825544e2776ab545ff0a9c674b68183120695cb (patch)
treea294fa38650e4ce511fc4d6c8b166f13e23ba18e /azalea-brigadier/src/context/command_context.rs
parent12370ab07609bf78baef4ec2302fa4ba44317dae (diff)
downloadazalea-drasl-f825544e2776ab545ff0a9c674b68183120695cb.tar.xz
CommandDispatcher is now Send+Sync
Diffstat (limited to 'azalea-brigadier/src/context/command_context.rs')
-rwxr-xr-xazalea-brigadier/src/context/command_context.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea-brigadier/src/context/command_context.rs b/azalea-brigadier/src/context/command_context.rs
index 88af2002..1734bb05 100755
--- a/azalea-brigadier/src/context/command_context.rs
+++ b/azalea-brigadier/src/context/command_context.rs
@@ -9,15 +9,15 @@ use std::{any::Any, collections::HashMap, fmt::Debug, rc::Rc, sync::Arc};
/// A built `CommandContextBuilder`.
pub struct CommandContext<S> {
- pub source: Rc<S>,
+ pub source: Arc<S>,
pub input: String,
pub arguments: HashMap<String, ParsedArgument>,
pub command: Command<S>,
pub root_node: Arc<RwLock<CommandNode<S>>>,
pub nodes: Vec<ParsedCommandNode<S>>,
pub range: StringRange,
- pub child: Option<Rc<CommandContext<S>>>,
- pub modifier: Option<Rc<RedirectModifier<S>>>,
+ pub child: Option<Arc<CommandContext<S>>>,
+ pub modifier: Option<Arc<RedirectModifier<S>>>,
pub forks: bool,
}
@@ -56,8 +56,8 @@ impl<S> Debug for CommandContext<S> {
}
impl<S> CommandContext<S> {
- pub fn copy_for(&self, source: Rc<S>) -> Self {
- if Rc::ptr_eq(&source, &self.source) {
+ pub fn copy_for(&self, source: Arc<S>) -> Self {
+ if Arc::ptr_eq(&source, &self.source) {
return self.clone();
}
CommandContext {