diff options
| author | Zeyla Hellyer <[email protected]> | 2017-02-28 11:43:53 -0800 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-02-28 11:43:53 -0800 |
| commit | 28743c8632458b79b472e3719d4754b57e116ad0 (patch) | |
| tree | 2c892dfbc7651577d4c576ad9d6c395e0523c61b /src/model/webhook.rs | |
| parent | Standardize message editing methods (diff) | |
| download | serenity-28743c8632458b79b472e3719d4754b57e116ad0.tar.xz serenity-28743c8632458b79b472e3719d4754b57e116ad0.zip | |
Pass by reference where possible
A lot of the `rest` methods took - for example a Map - by value, where
they could instead take a reference. While this only prevents one clone
in the library, user-land code should no longer need to clone maps when
using the `rest` module.
Diffstat (limited to 'src/model/webhook.rs')
| -rw-r--r-- | src/model/webhook.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/model/webhook.rs b/src/model/webhook.rs index 7448fcf..4f831d9 100644 --- a/src/model/webhook.rs +++ b/src/model/webhook.rs @@ -83,7 +83,7 @@ impl Webhook { map = map.insert("name", name); } - match rest::edit_webhook_with_token(self.id.0, &self.token, map.build()) { + match rest::edit_webhook_with_token(self.id.0, &self.token, &map.build()) { Ok(replacement) => { mem::replace(self, replacement); @@ -142,7 +142,7 @@ impl Webhook { /// ``` #[inline] pub fn execute<F: FnOnce(ExecuteWebhook) -> ExecuteWebhook>(&self, f: F) -> Result<Message> { - rest::execute_webhook(self.id.0, &self.token, f(ExecuteWebhook::default()).0.build()) + rest::execute_webhook(self.id.0, &self.token, &f(ExecuteWebhook::default()).0.build()) } /// Retrieves the latest information about the webhook, editing the |