diff options
| author | acdenisSK <[email protected]> | 2017-10-02 22:29:10 +0200 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-10-09 15:47:05 -0700 |
| commit | 2911f677431820ac858bae39ce53a3d6e202da1b (patch) | |
| tree | 1a65a208341e2a8006807f96074ca17cd0aaaed8 /src/model/channel/reaction.rs | |
| parent | `to_owned` -> `to_string` (diff) | |
| download | serenity-2911f677431820ac858bae39ce53a3d6e202da1b.tar.xz serenity-2911f677431820ac858bae39ce53a3d6e202da1b.zip | |
Use the de-generification trick.
Fixes #168
Diffstat (limited to 'src/model/channel/reaction.rs')
| -rw-r--r-- | src/model/channel/reaction.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/model/channel/reaction.rs b/src/model/channel/reaction.rs index 8edc2e9..976ea3d 100644 --- a/src/model/channel/reaction.rs +++ b/src/model/channel/reaction.rs @@ -106,12 +106,20 @@ impl Reaction { after: Option<U>) -> Result<Vec<User>> where R: Into<ReactionType>, U: Into<UserId> { + self._users(reaction_type.into(), limit, after.map(|u| u.into())) + } + + fn _users(&self, + reaction_type: ReactionType, + limit: Option<u8>, + after: Option<UserId>) + -> Result<Vec<User>> { http::get_reaction_users( self.channel_id.0, self.message_id.0, - &reaction_type.into(), + &reaction_type, limit.unwrap_or(50), - after.map(|u| u.into().0), + after.map(|u| u.0), ) } } |