aboutsummaryrefslogtreecommitdiff
path: root/src/model/id.rs
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-12-29 11:49:28 -0800
committerAustin Hellyer <[email protected]>2016-12-29 11:49:28 -0800
commitfa4952b30fec8f62c9882c2c9ef9836eae2cd9a9 (patch)
treecae13f61f6634183ff73c24703c66d57b6b1d8e8 /src/model/id.rs
parentAdd user static avatar url methods (diff)
downloadserenity-fa4952b30fec8f62c9882c2c9ef9836eae2cd9a9.tar.xz
serenity-fa4952b30fec8f62c9882c2c9ef9836eae2cd9a9.zip
Use conditional blocks over macros
Diffstat (limited to 'src/model/id.rs')
-rw-r--r--src/model/id.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/model/id.rs b/src/model/id.rs
index b6cece6..aec5bfe 100644
--- a/src/model/id.rs
+++ b/src/model/id.rs
@@ -19,11 +19,12 @@ impl ChannelId {
/// requested over REST.
#[cfg(feature="methods")]
pub fn get(&self) -> Result<Channel> {
- feature_cache_enabled! {{
+ #[cfg(feature="cache")]
+ {
if let Some(channel) = CACHE.read().unwrap().get_channel(*self) {
return Ok(channel.clone_inner());
}
- }}
+ }
rest::get_channel(self.0)
}