diff options
| author | mat <git@matdoes.dev> | 2023-05-05 23:23:11 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-05-05 23:23:11 -0500 |
| commit | f825544e2776ab545ff0a9c674b68183120695cb (patch) | |
| tree | a294fa38650e4ce511fc4d6c8b166f13e23ba18e /azalea-brigadier/src/context/command_context.rs | |
| parent | 12370ab07609bf78baef4ec2302fa4ba44317dae (diff) | |
| download | azalea-drasl-f825544e2776ab545ff0a9c674b68183120695cb.tar.xz | |
CommandDispatcher is now Send+Sync
Diffstat (limited to 'azalea-brigadier/src/context/command_context.rs')
| -rwxr-xr-x | azalea-brigadier/src/context/command_context.rs | 10 |
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 { |
