diff options
| author | Austin Hellyer <[email protected]> | 2017-01-23 12:16:06 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2017-01-23 12:16:06 -0800 |
| commit | 651c618f17cb92d3ea9bbd1d5f5c92a015ff64e0 (patch) | |
| tree | dcf452e8fe73411af331678a769cb769a32dd12e /src/client/rest/mod.rs | |
| parent | Fix no-framework compilation (diff) | |
| download | serenity-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.rs | 3 |
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"); |