aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 88fd157..2be1d99 100644
--- a/src/client/context.rs
+++ b/src/client/context.rs
@@ -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::new();
+ let mut map = HashMap::with_capacity(2);
feature_cache! {
{
@@ -101,8 +101,8 @@ impl Context {
map.insert("username", Value::String(user.name.clone()));
- if let Some(email) = user.email.as_ref() {
- map.insert("email", Value::String(email.clone()));
+ if let Some(email) = user.email {
+ map.insert("email", Value::String(email));
}
}
}