aboutsummaryrefslogtreecommitdiff
path: root/src/client/rest/mod.rs
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2017-01-23 12:16:06 -0800
committerAustin Hellyer <[email protected]>2017-01-23 12:16:06 -0800
commit651c618f17cb92d3ea9bbd1d5f5c92a015ff64e0 (patch)
treedcf452e8fe73411af331678a769cb769a32dd12e /src/client/rest/mod.rs
parentFix no-framework compilation (diff)
downloadserenity-651c618f17cb92d3ea9bbd1d5f5c92a015ff64e0.tar.xz
serenity-651c618f17cb92d3ea9bbd1d5f5c92a015ff64e0.zip
Switch to a mostly-fully OOP approach
The context is now strictly in relation to the context of the current channel related to the event, if any. See Context::say for a list of events that the context can be used for.
Diffstat (limited to 'src/client/rest/mod.rs')
-rw-r--r--src/client/rest/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/client/rest/mod.rs b/src/client/rest/mod.rs
index 43f8f8c..fd4cc2f 100644
--- a/src/client/rest/mod.rs
+++ b/src/client/rest/mod.rs
@@ -517,7 +517,7 @@ pub fn delete_reaction(channel_id: u64,
user_id: Option<u64>,
reaction_type: ReactionType)
-> Result<()> {
- let user = user_id.map(|uid| uid.to_string()).unwrap_or("@me".to_string());
+ let user = user_id.map(|uid| uid.to_string()).unwrap_or_else(|| "@me".to_string());
verify(204, request!(Route::ChannelsIdMessagesIdReactionsUserIdType(channel_id),
delete,
@@ -702,7 +702,6 @@ pub fn edit_note(user_id: u64, map: Value) -> Result<()> {
/// **Note**: this token change may cause requests made between the actual token
/// change and when the token is internally changed to be invalid requests, as
/// the token may be outdated.
-///
pub fn edit_profile(map: Value) -> Result<CurrentUser> {
let body = serde_json::to_string(&map)?;
let response = request!(Route::UsersMe, patch(body), "/users/@me");