diff options
| author | mat <git@matdoes.dev> | 2023-10-12 20:18:53 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-10-12 20:18:53 -0500 |
| commit | d82230a427847e17ed4ce105022a3c89b1d9bc6a (patch) | |
| tree | ba1186c1b8c8ceff4a3a35971f7cbd534d174ff9 /azalea-brigadier/src/builder | |
| parent | 38db231ea8fa0fb223e16637db0b6ec65b2b81ef (diff) | |
| download | azalea-drasl-d82230a427847e17ed4ce105022a3c89b1d9bc6a.tar.xz | |
less Arc<S> in brigadier
Diffstat (limited to 'azalea-brigadier/src/builder')
| -rwxr-xr-x | azalea-brigadier/src/builder/argument_builder.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/azalea-brigadier/src/builder/argument_builder.rs b/azalea-brigadier/src/builder/argument_builder.rs index 10191463..9d3e8cad 100755 --- a/azalea-brigadier/src/builder/argument_builder.rs +++ b/azalea-brigadier/src/builder/argument_builder.rs @@ -21,7 +21,7 @@ pub struct ArgumentBuilder<S> { arguments: CommandNode<S>, command: Command<S>, - requirement: Arc<dyn Fn(Arc<S>) -> bool + Send + Sync>, + requirement: Arc<dyn Fn(&S) -> bool + Send + Sync>, target: Option<Arc<RwLock<CommandNode<S>>>>, forks: bool, @@ -96,13 +96,13 @@ impl<S> ArgumentBuilder<S> { /// # let mut subject = CommandDispatcher::<CommandSource>::new(); /// # subject.register( /// literal("foo") - /// .requires(|s: Arc<CommandSource>| s.opped) + /// .requires(|s: &CommandSource| s.opped) /// // ... /// # .executes(|ctx: &CommandContext<CommandSource>| 42) /// # ); pub fn requires<F>(mut self, requirement: F) -> Self where - F: Fn(Arc<S>) -> bool + Send + Sync + 'static, + F: Fn(&S) -> bool + Send + Sync + 'static, { self.requirement = Arc::new(requirement); self |
