aboutsummaryrefslogtreecommitdiff
path: root/src/framework/create_command.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-07-27 08:10:41 +0200
committeracdenisSK <[email protected]>2017-07-27 08:10:41 +0200
commit70b5097aaac85f970c32ceb988dbb5f5d575ee0f (patch)
treed2f391d3b552cfae58b74748a2a2aa5ae80c7986 /src/framework/create_command.rs
parentrustfmt (diff)
downloadserenity-70b5097aaac85f970c32ceb988dbb5f5d575ee0f.tar.xz
serenity-70b5097aaac85f970c32ceb988dbb5f5d575ee0f.zip
Change the config a bit, and a few nitpicks
Diffstat (limited to 'src/framework/create_command.rs')
-rw-r--r--src/framework/create_command.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/framework/create_command.rs b/src/framework/create_command.rs
index d97f6fa..d2ae31f 100644
--- a/src/framework/create_command.rs
+++ b/src/framework/create_command.rs
@@ -65,8 +65,7 @@ impl CreateCommand {
/// }
/// ```
pub fn check<F>(mut self, check: F) -> Self
- where
- F: Fn(&mut Context, &Message, &Arc<Command>) -> bool + Send + Sync + 'static, {
+ where F: Fn(&mut Context, &Message, &Arc<Command>) -> bool + Send + Sync + 'static {
self.0.checks.push(Box::new(check));
self
@@ -100,8 +99,10 @@ impl CreateCommand {
///
/// [`exec_str`]: #method.exec_str
pub fn exec<F>(mut self, func: F) -> Self
- where
- F: Fn(&mut Context, &Message, Vec<String>) -> Result<(), String> + Send + Sync + 'static, {
+ where F: Fn(&mut Context, &Message, Vec<String>) -> Result<(), String>
+ + Send
+ + Sync
+ + 'static {
self.0.exec = CommandType::Basic(Box::new(func));
self
@@ -113,12 +114,9 @@ impl CreateCommand {
///
/// You can return `Err(string)` if there's an error.
pub fn exec_help<F>(mut self, f: F) -> Self
- where
- F: Fn(&mut Context, &Message, HashMap<String, Arc<CommandGroup>>, &[String])
- -> Result<(), String>
- + Send
- + Sync
- + 'static, {
+ where F: Fn(&mut Context, &Message, HashMap<String, Arc<CommandGroup>>, &[String])
+ -> Result<(), String>
+ + 'static {
self.0.exec = CommandType::WithCommands(Box::new(f));
self