aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel/group.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-10-02 22:29:10 +0200
committerZeyla Hellyer <[email protected]>2017-10-09 15:47:05 -0700
commit2911f677431820ac858bae39ce53a3d6e202da1b (patch)
tree1a65a208341e2a8006807f96074ca17cd0aaaed8 /src/model/channel/group.rs
parent`to_owned` -> `to_string` (diff)
downloadserenity-2911f677431820ac858bae39ce53a3d6e202da1b.tar.xz
serenity-2911f677431820ac858bae39ce53a3d6e202da1b.zip
Use the de-generification trick.
Fixes #168
Diffstat (limited to 'src/model/channel/group.rs')
-rw-r--r--src/model/channel/group.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/model/channel/group.rs b/src/model/channel/group.rs
index 418ce3a..dfccca3 100644
--- a/src/model/channel/group.rs
+++ b/src/model/channel/group.rs
@@ -49,8 +49,10 @@ impl Group {
///
/// [`http::add_group_recipient`]: ../http/fn.add_group_recipient.html
pub fn add_recipient<U: Into<UserId>>(&self, user: U) -> Result<()> {
- let user = user.into();
+ self._add_recipient(user.into())
+ }
+ fn _add_recipient(&self, user: UserId) -> Result<()> {
// If the group already contains the recipient, do nothing.
if self.recipients.contains_key(&user) {
return Ok(());
@@ -253,8 +255,10 @@ impl Group {
///
/// **Note**: This is only available to the group owner.
pub fn remove_recipient<U: Into<UserId>>(&self, user: U) -> Result<()> {
- let user = user.into();
+ self._remove_recipient(user.into())
+ }
+ fn _remove_recipient(&self, user: UserId) -> Result<()> {
// If the group does not contain the recipient already, do nothing.
if !self.recipients.contains_key(&user) {
return Ok(());