From f825544e2776ab545ff0a9c674b68183120695cb Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 5 May 2023 23:23:11 -0500 Subject: CommandDispatcher is now Send+Sync --- azalea-brigadier/src/context/command_context_builder.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'azalea-brigadier/src/context/command_context_builder.rs') 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, pub root: Arc>>, pub nodes: Vec>, pub dispatcher: &'a CommandDispatcher, - pub source: Rc, + pub source: Arc, pub command: Command, - pub child: Option>>, + pub child: Option>>, pub range: StringRange, - pub modifier: Option>>, + pub modifier: Option>>, pub forks: bool, } @@ -44,7 +44,7 @@ impl Clone for CommandContextBuilder<'_, S> { impl<'a, S> CommandContextBuilder<'a, S> { pub fn new( dispatcher: &'a CommandDispatcher, - source: Rc, + source: Arc, root_node: Arc>>, 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>) -> &Self { + pub fn with_child(&mut self, child: Arc>) -> &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(), -- cgit v1.2.3