diff options
| author | Austin Hellyer <[email protected]> | 2016-11-24 11:26:15 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-24 11:26:15 -0800 |
| commit | 290111a02f59f278374a482a8c8df12147ba4ea9 (patch) | |
| tree | a27137c29deb678557122119c882c84963d89604 /src/model/id.rs | |
| parent | Ignore WebSocketError::NoDataAvailable (diff) | |
| download | serenity-290111a02f59f278374a482a8c8df12147ba4ea9.tar.xz serenity-290111a02f59f278374a482a8c8df12147ba4ea9.zip | |
Rename guild structs to Guild and PartialGuild
Diffstat (limited to 'src/model/id.rs')
| -rw-r--r-- | src/model/id.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/model/id.rs b/src/model/id.rs index d9c131e..9c9cb4d 100644 --- a/src/model/id.rs +++ b/src/model/id.rs @@ -76,7 +76,7 @@ impl From<Emoji> for EmojiId { impl GuildId { /// Search the cache for the guild. #[cfg(feature="methods")] - pub fn find(&self) -> Option<LiveGuild> { + pub fn find(&self) -> Option<Guild> { CACHE.read().unwrap().get_guild(*self).cloned() } @@ -85,7 +85,7 @@ impl GuildId { /// Note that this will not be a complete guild, as REST does not send /// all data with a guild retrieval. #[cfg(feature="methods")] - pub fn get(&self) -> Result<Guild> { + pub fn get(&self) -> Result<PartialGuild> { http::get_guild(self.0) } @@ -117,8 +117,8 @@ impl GuildId { } } -impl From<Guild> for GuildId { - fn from(guild: Guild) -> GuildId { +impl From<PartialGuild> for GuildId { + fn from(guild: PartialGuild) -> GuildId { guild.id } } @@ -135,8 +135,8 @@ impl From<InviteGuild> for GuildId { } } -impl From<LiveGuild> for GuildId { - fn from(live_guild: LiveGuild) -> GuildId { +impl From<Guild> for GuildId { + fn from(live_guild: Guild) -> GuildId { live_guild.id } } |