aboutsummaryrefslogtreecommitdiff
path: root/src/framework/create_command.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-07-27 06:42:48 +0200
committeracdenisSK <[email protected]>2017-07-27 07:30:23 +0200
commit550030264952f0e0043b63f4582bb817ef8bbf37 (patch)
treeb921e2f78fd603a5ca671623083a32806fd16090 /src/framework/create_command.rs
parentUse a consistent indentation style (diff)
downloadserenity-550030264952f0e0043b63f4582bb817ef8bbf37.tar.xz
serenity-550030264952f0e0043b63f4582bb817ef8bbf37.zip
rustfmt
Diffstat (limited to 'src/framework/create_command.rs')
-rw-r--r--src/framework/create_command.rs22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/framework/create_command.rs b/src/framework/create_command.rs
index 4f3ab27..d97f6fa 100644
--- a/src/framework/create_command.rs
+++ b/src/framework/create_command.rs
@@ -1,10 +1,10 @@
-pub use super::{Command, CommandType, CommandGroup};
+pub use super::{Command, CommandGroup, CommandType};
use std::collections::HashMap;
use std::default::Default;
use std::sync::Arc;
-use ::client::Context;
-use ::model::{Message, Permissions};
+use client::Context;
+use model::{Message, Permissions};
pub struct CreateCommand(pub Command);
@@ -52,7 +52,8 @@ impl CreateCommand {
/// .desc("Replies to a ping with a pong")
/// .exec(ping)));
///
- /// fn ping(_context: &mut Context, message: &Message, _args: Vec<String>) -> Result<(), String> {
+ /// fn ping(_context: &mut Context, message: &Message, _args: Vec<String>) -> Result<(),
+ /// String> {
/// let _ = message.channel_id.say("Pong!");
///
/// Ok(())
@@ -64,7 +65,8 @@ 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
@@ -98,7 +100,8 @@ 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
@@ -110,7 +113,12 @@ 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>
+ + Send
+ + Sync
+ + 'static, {
self.0.exec = CommandType::WithCommands(Box::new(f));
self