diff options
Diffstat (limited to 'src/framework/standard/command.rs')
| -rw-r--r-- | src/framework/standard/command.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/framework/standard/command.rs b/src/framework/standard/command.rs index 8cf4fc5..6b90479 100644 --- a/src/framework/standard/command.rs +++ b/src/framework/standard/command.rs @@ -137,11 +137,13 @@ impl Command for Box<Command> { } } -pub(crate) struct A(pub fn(&mut Context, &Message, Args) -> Result<(), Error>); - -impl Command for A { +impl<F> Command for F where F: Fn(&mut Context, &Message, Args) -> Result<(), Error> + + Send + + Sync + + ?Sized + + 'static { fn execute(&self, c: &mut Context, m: &Message, a: Args) -> Result<(), Error> { - (self.0)(c, m, a) + (*self)(c, m, a) } } |