diff options
| author | acdenisSK <[email protected]> | 2017-11-20 14:55:32 +0100 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-11-20 14:55:32 +0100 |
| commit | 0aa55a2b9b757321d5b8bb9e512813aa9d0a62ca (patch) | |
| tree | a9e9243c873eadc2ae4a8c7a4733830814bf2c08 /src/framework/standard/mod.rs | |
| parent | Add guild invite to readme (diff) | |
| download | serenity-0aa55a2b9b757321d5b8bb9e512813aa9d0a62ca.tar.xz serenity-0aa55a2b9b757321d5b8bb9e512813aa9d0a62ca.zip | |
Add an impl for `Fn(&mut Context, &Message, Args)`
Diffstat (limited to 'src/framework/standard/mod.rs')
| -rw-r--r-- | src/framework/standard/mod.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index b350a91..ef78f61 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -10,7 +10,7 @@ mod args; pub use self::args::{Args, Iter, FromStrZc, Error as ArgError}; pub(crate) use self::buckets::{Bucket, Ratelimit}; -pub(crate) use self::command::{A, Help}; +pub(crate) use self::command::Help; pub use self::command::{Command, CommandGroup, CommandOptions, Error as CommandError}; pub use self::command::CommandOrAlias; pub use self::configuration::Configuration; @@ -634,18 +634,14 @@ impl StandardFramework { pub fn on(self, name: &str, f: fn(&mut Context, &Message, Args) -> Result<(), CommandError>) -> Self { - self._cmd(name, A(f)) + self.cmd(name, f) } /// Same as [`on`], but accepts a [`Command`] directly. /// /// [`on`]: #method.on /// [`Command`]: trait.Command.html - pub fn cmd<C: Command + 'static>(self, name: &str, c: C) -> Self { - self._cmd(name, c) - } - - fn _cmd<C: Command + 'static>(mut self, name: &str, c: C) -> Self { + pub fn cmd<C: Command + 'static>(mut self, name: &str, c: C) -> Self { { let ungrouped = self.groups .entry("Ungrouped".to_string()) |