diff options
| author | Zeyla Hellyer <[email protected]> | 2018-07-14 20:06:38 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2018-07-14 20:07:45 -0700 |
| commit | 8a7bf5721545905ae3b0b7f2bf5ec5bb9f2c9fc3 (patch) | |
| tree | 8134d2ee2a1d9e7ec937defb889f41ecac809cca /src | |
| parent | Implement Mentionable for Group (diff) | |
| download | serenity-8a7bf5721545905ae3b0b7f2bf5ec5bb9f2c9fc3.tar.xz serenity-8a7bf5721545905ae3b0b7f2bf5ec5bb9f2c9fc3.zip | |
Abstract impls in Channel's Mentionable impl
Abstract the implementations for each of Channel's variants' `Mentionable`
implementations by using the underlying impl.
Diffstat (limited to 'src')
| -rw-r--r-- | src/model/misc.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/model/misc.rs b/src/model/misc.rs index d840c6f..50a5ff2 100644 --- a/src/model/misc.rs +++ b/src/model/misc.rs @@ -28,10 +28,10 @@ impl Mentionable for ChannelId { impl Mentionable for Channel { fn mention(&self) -> String { match *self { - Channel::Guild(ref x) => format!("<#{}>", x.with(|x| x.id.0)), - Channel::Private(ref x) => format!("<#{}>", x.with(|x| x.id.0)), - Channel::Group(ref x) => format!("<#{}>", x.with(|x| x.channel_id.0)), - Channel::Category(ref x) => format!("<#{}>", x.with(|x| x.id.0)), + Channel::Guild(ref x) => x.with(Mentionable::mention), + Channel::Private(ref x) => x.with(Mentionable::mention), + Channel::Group(ref x) => x.with(Mentionable::mention), + Channel::Category(ref x) => x.with(Mentionable::mention), } } } |