From 8a7bf5721545905ae3b0b7f2bf5ec5bb9f2c9fc3 Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Sat, 14 Jul 2018 20:06:38 -0700 Subject: Abstract impls in Channel's Mentionable impl Abstract the implementations for each of Channel's variants' `Mentionable` implementations by using the underlying impl. --- src/model/misc.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/model') 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), } } } -- cgit v1.2.3