aboutsummaryrefslogtreecommitdiff
path: root/src/builder/execute_webhook.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-12-27 18:29:34 +0100
committeracdenisSK <[email protected]>2017-12-27 18:33:29 +0100
commit3a0c8908ce837f6fe64f865a1a7a9de63cbd237c (patch)
treea8597bb4a7d49cfd614a85d3f2b5a95d3df9e055 /src/builder/execute_webhook.rs
parentUpdate dependencies (diff)
downloadserenity-3a0c8908ce837f6fe64f865a1a7a9de63cbd237c.tar.xz
serenity-3a0c8908ce837f6fe64f865a1a7a9de63cbd237c.zip
Improve performance of builders even further
By negating hashing altogether. The increase is around 1000-ish nanoseconds saved.
Diffstat (limited to 'src/builder/execute_webhook.rs')
-rw-r--r--src/builder/execute_webhook.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/builder/execute_webhook.rs b/src/builder/execute_webhook.rs
index fb48e96..9e7579c 100644
--- a/src/builder/execute_webhook.rs
+++ b/src/builder/execute_webhook.rs
@@ -1,6 +1,6 @@
use serde_json::Value;
-use std::collections::HashMap;
use std::default::Default;
+use super::VecMap;
/// A builder to create the inner content of a [`Webhook`]'s execution.
///
@@ -47,7 +47,7 @@ use std::default::Default;
/// [`Webhook::execute`]: ../model/struct.Webhook.html#method.execute
/// [`execute_webhook`]: ../http/fn.execute_webhook.html
#[derive(Clone, Debug)]
-pub struct ExecuteWebhook(pub HashMap<&'static str, Value>);
+pub struct ExecuteWebhook(pub VecMap<&'static str, Value>);
impl ExecuteWebhook {
/// Override the default avatar of the webhook with an image URL.
@@ -179,7 +179,7 @@ impl Default for ExecuteWebhook {
/// [`Webhook`]: ../model/struct.Webhook.html
/// [`tts`]: #method.tts
fn default() -> ExecuteWebhook {
- let mut map = HashMap::new();
+ let mut map = VecMap::new();
map.insert("tts", Value::Bool(false));
ExecuteWebhook(map)