aboutsummaryrefslogtreecommitdiff
path: root/src/client
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/client
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/client')
-rw-r--r--src/client/context.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/context.rs b/src/client/context.rs
index b15e172..a7bd903 100644
--- a/src/client/context.rs
+++ b/src/client/context.rs
@@ -10,7 +10,7 @@ use builder::EditProfile;
#[cfg(feature = "builder")]
use internal::prelude::*;
#[cfg(feature = "builder")]
-use std::collections::HashMap;
+use builder::VecMap;
#[cfg(all(feature = "builder", feature = "cache"))]
use super::CACHE;
#[cfg(feature = "builder")]
@@ -85,7 +85,7 @@ impl Context {
/// ```
#[cfg(feature = "builder")]
pub fn edit_profile<F: FnOnce(EditProfile) -> EditProfile>(&self, f: F) -> Result<CurrentUser> {
- let mut map = HashMap::with_capacity(2);
+ let mut map = VecMap::with_capacity(2);
feature_cache! {
{
@@ -107,7 +107,7 @@ impl Context {
}
}
- let edited = utils::hashmap_to_json_map(f(EditProfile(map)).0);
+ let edited = utils::vecmap_to_json_map(f(EditProfile(map)).0);
http::edit_profile(&edited)
}