diff options
| author | Zeyla Hellyer <[email protected]> | 2017-12-16 13:24:09 -0800 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-12-16 13:24:09 -0800 |
| commit | 9b53582f5e5e9650abda4106124e7f9f4e78a90c (patch) | |
| tree | 88bd56a75b1d110ea049abbaea88bb6e8a83dac3 /src/framework/standard/command.rs | |
| parent | Fix compilation of examples (diff) | |
| download | serenity-9b53582f5e5e9650abda4106124e7f9f4e78a90c.tar.xz serenity-9b53582f5e5e9650abda4106124e7f9f4e78a90c.zip | |
Fix most clippy lints, take more refeernces
Fix clippy lints and subsequently accept references for more function
parameters.
Diffstat (limited to 'src/framework/standard/command.rs')
| -rw-r--r-- | src/framework/standard/command.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/framework/standard/command.rs b/src/framework/standard/command.rs index be0196c..5138596 100644 --- a/src/framework/standard/command.rs +++ b/src/framework/standard/command.rs @@ -13,7 +13,7 @@ pub type Check = Fn(&mut Context, &Message, &mut Args, &CommandOptions) -> bool + Sync + 'static; -pub type HelpFunction = fn(&mut Context, &Message, &HelpOptions, HashMap<String, Arc<CommandGroup>>, Args) +pub type HelpFunction = fn(&mut Context, &Message, &HelpOptions, HashMap<String, Arc<CommandGroup>>, &Args) -> Result<(), Error>; pub struct Help(pub HelpFunction, pub Arc<HelpOptions>); @@ -25,7 +25,7 @@ impl Debug for Help { } impl HelpCommand for Help { - fn execute(&self, c: &mut Context, m: &Message, ho: &HelpOptions,hm: HashMap<String, Arc<CommandGroup>>, a: Args) -> Result<(), Error> { + fn execute(&self, c: &mut Context, m: &Message, ho: &HelpOptions,hm: HashMap<String, Arc<CommandGroup>>, a: &Args) -> Result<(), Error> { (self.0)(c, m, ho, hm, a) } } @@ -176,7 +176,7 @@ pub struct HelpOptions { } pub trait HelpCommand: Send + Sync + 'static { - fn execute(&self, &mut Context, &Message, &HelpOptions, HashMap<String, Arc<CommandGroup>>, Args) -> Result<(), Error>; + fn execute(&self, &mut Context, &Message, &HelpOptions, HashMap<String, Arc<CommandGroup>>, &Args) -> Result<(), Error>; fn options(&self) -> Arc<CommandOptions> { Arc::clone(&DEFAULT_OPTIONS) @@ -184,7 +184,7 @@ pub trait HelpCommand: Send + Sync + 'static { } impl HelpCommand for Arc<HelpCommand> { - fn execute(&self, c: &mut Context, m: &Message, ho: &HelpOptions, hm: HashMap<String, Arc<CommandGroup>>, a: Args) -> Result<(), Error> { + fn execute(&self, c: &mut Context, m: &Message, ho: &HelpOptions, hm: HashMap<String, Arc<CommandGroup>>, a: &Args) -> Result<(), Error> { (**self).execute(c, m, ho, hm, a) } } |