aboutsummaryrefslogtreecommitdiff
path: root/src/client/context.rs
diff options
context:
space:
mode:
authorKen Swenson <[email protected]>2018-11-25 14:13:40 -0800
committerAlex M. M <[email protected]>2018-11-25 23:13:40 +0100
commit9a07cc05708e43f1f5777c353b41830bd414e5af (patch)
treed6340432099c1daf960186be58d9449128c454bb /src/client/context.rs
parentFix links in `Event` (diff)
downloadserenity-9a07cc05708e43f1f5777c353b41830bd414e5af.tar.xz
serenity-9a07cc05708e43f1f5777c353b41830bd414e5af.zip
Change all builders to mutably borrow (#443)
Diffstat (limited to 'src/client/context.rs')
-rw-r--r--src/client/context.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/context.rs b/src/client/context.rs
index 9ca4f55..04fe642 100644
--- a/src/client/context.rs
+++ b/src/client/context.rs
@@ -88,7 +88,8 @@ impl Context {
/// ```
#[cfg(feature = "builder")]
#[deprecated(since = "0.5.6", note = "Use the http module instead.")]
- pub fn edit_profile<F: FnOnce(EditProfile) -> EditProfile>(&self, f: F) -> Result<CurrentUser> {
+ pub fn edit_profile<F>(&self, f: F) -> Result<CurrentUser>
+ where F: FnOnce(&mut EditProfile) -> &mut EditProfile {
let mut map = VecMap::with_capacity(2);
feature_cache! {
@@ -111,7 +112,10 @@ impl Context {
}
}
- let edited = vecmap_to_json_map(f(EditProfile(map)).0);
+ let mut edit_profile = EditProfile(map);
+ f(&mut edit_profile);
+
+ let edited = vecmap_to_json_map(edit_profile.0);
http::edit_profile(&edited)
}