diff options
| author | Zeyla Hellyer <[email protected]> | 2017-09-18 20:28:59 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-09-18 20:28:59 -0700 |
| commit | f42f6175a0aa96770f5665f00ae8e61453a5e6fa (patch) | |
| tree | ab346aff6133ebc37af5d83c2fa5aab6aedccaa4 /src/framework | |
| parent | Add Send/Sync to framework items (diff) | |
| download | serenity-f42f6175a0aa96770f5665f00ae8e61453a5e6fa.tar.xz serenity-f42f6175a0aa96770f5665f00ae8e61453a5e6fa.zip | |
Also rustfmt
Diffstat (limited to 'src/framework')
| -rw-r--r-- | src/framework/standard/command.rs | 9 | ||||
| -rw-r--r-- | src/framework/standard/create_command.rs | 4 | ||||
| -rw-r--r-- | src/framework/standard/mod.rs | 11 |
3 files changed, 17 insertions, 7 deletions
diff --git a/src/framework/standard/command.rs b/src/framework/standard/command.rs index 66b6490..96c2f7d 100644 --- a/src/framework/standard/command.rs +++ b/src/framework/standard/command.rs @@ -4,11 +4,16 @@ use client::Context; use model::{Message, Permissions}; use std::collections::HashMap; -pub type Check = Fn(&mut Context, &Message, &mut Args, &Arc<Command>) -> bool + Send + Sync + 'static; +pub type Check = Fn(&mut Context, &Message, &mut Args, &Arc<Command>) -> bool + + Send + + Sync + + 'static; pub type Exec = Fn(&mut Context, &Message, Args) -> Result<(), String> + Send + Sync + 'static; pub type Help = Fn(&mut Context, &Message, HashMap<String, Arc<CommandGroup>>, Args) -> Result<(), String> - + Send + Sync + 'static; + + Send + + Sync + + 'static; pub type BeforeHook = Fn(&mut Context, &Message, &str) -> bool + Send + Sync + 'static; pub type AfterHook = Fn(&mut Context, &Message, &str, Result<(), String>) + Send + Sync + 'static; pub(crate) type InternalCommand = Arc<Command>; diff --git a/src/framework/standard/create_command.rs b/src/framework/standard/create_command.rs index b6e8fda..30ef491 100644 --- a/src/framework/standard/create_command.rs +++ b/src/framework/standard/create_command.rs @@ -117,8 +117,8 @@ impl CreateCommand { pub fn exec_help<F>(mut self, f: F) -> Self where F: Fn(&mut Context, &Message, HashMap<String, Arc<CommandGroup>>, Args) -> Result<(), String> - + Send - + Sync + + Send + + Sync + 'static { self.0.exec = CommandType::WithCommands(Box::new(f)); diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index 8a00691..913a1c5 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -290,7 +290,10 @@ impl StandardFramework { limit: i32, check: Check) -> Self - where Check: Fn(&mut Context, Option<GuildId>, ChannelId, UserId) -> bool + Send + Sync + 'static, + where Check: Fn(&mut Context, Option<GuildId>, ChannelId, UserId) -> bool + + Send + + Sync + + 'static, S: Into<String> { self.buckets.insert( s.into(), @@ -341,7 +344,8 @@ impl StandardFramework { limit: i32, check: Check) -> Self - where Check: Fn(&mut Context, ChannelId, UserId) -> bool + Send + Sync + 'static, S: Into<String> { + where Check: Fn(&mut Context, ChannelId, UserId) -> bool + Send + Sync + 'static, + S: Into<String> { self.buckets.insert( s.into(), Bucket { @@ -594,7 +598,8 @@ impl StandardFramework { /// # } /// ``` pub fn on<F, S>(mut self, command_name: S, f: F) -> Self - where F: Fn(&mut Context, &Message, Args) -> Result<(), String> + Send + Sync + 'static, S: Into<String> { + where F: Fn(&mut Context, &Message, Args) -> Result<(), String> + Send + Sync + 'static, + S: Into<String> { { let ungrouped = self.groups .entry("Ungrouped".to_owned()) |