diff options
| author | Austin Hellyer <[email protected]> | 2016-11-22 07:57:51 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-22 07:57:51 -0800 |
| commit | d4726f899cf6b86d805a8a2a77ec57782ec3bdd6 (patch) | |
| tree | 7966be3c6d6c4284bb618b88b3f146dd412af677 /src/model/id.rs | |
| parent | Don't typo CreateEmbed::image field (diff) | |
| download | serenity-d4726f899cf6b86d805a8a2a77ec57782ec3bdd6.tar.xz serenity-d4726f899cf6b86d805a8a2a77ec57782ec3bdd6.zip | |
Rename the State to Cache
Diffstat (limited to 'src/model/id.rs')
| -rw-r--r-- | src/model/id.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/model/id.rs b/src/model/id.rs index 8c94dec..f055784 100644 --- a/src/model/id.rs +++ b/src/model/id.rs @@ -1,22 +1,22 @@ use super::*; #[cfg(feature = "methods")] -use ::client::{STATE, http}; +use ::client::{CACHE, http}; #[cfg(feature = "methods")] use ::internal::prelude::*; impl ChannelId { - /// Search the state for the channel with the Id. + /// Search the cache for the channel with the Id. #[cfg(feature="methods")] pub fn find(&self) -> Option<Channel> { - STATE.lock().unwrap().get_channel(*self) + CACHE.lock().unwrap().get_channel(*self) } - /// Search the state for the channel. If it can't be found, the channel is + /// Search the cache for the channel. If it can't be found, the channel is /// requested over REST. #[cfg(feature="methods")] pub fn get(&self) -> Result<Channel> { - if let Some(channel) = STATE.lock().unwrap().get_channel(*self) { + if let Some(channel) = CACHE.lock().unwrap().get_channel(*self) { return Ok(channel.clone()); } @@ -74,10 +74,10 @@ impl From<Emoji> for EmojiId { } impl GuildId { - /// Search the state for the guild. + /// Search the cache for the guild. #[cfg(feature="methods")] pub fn find(&self) -> Option<LiveGuild> { - STATE.lock().unwrap().get_guild(*self).cloned() + CACHE.lock().unwrap().get_guild(*self).cloned() } /// Requests the guild over REST. @@ -160,10 +160,10 @@ impl From<Role> for RoleId { } impl RoleId { - /// Search the state for the role. + /// Search the cache for the role. #[cfg(feature="methods")] pub fn find(&self) -> Option<Role> { - STATE.lock() + CACHE.lock() .unwrap() .guilds .values() |