diff options
| author | Zeyla Hellyer <[email protected]> | 2017-12-27 16:39:45 -0800 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-12-27 16:40:42 -0800 |
| commit | 0b1f684106031657d6bf581206c06e5443d06da9 (patch) | |
| tree | bd7a78e5ea5c504068d61a220ceb8b8b2fa46a73 /src/model/gateway.rs | |
| parent | Improve performance of builders even further (diff) | |
| download | serenity-0b1f684106031657d6bf581206c06e5443d06da9.tar.xz serenity-0b1f684106031657d6bf581206c06e5443d06da9.zip | |
Add missing 'num' implementations on models
Add missing 'num' implementations from the following models:
- `channel::{ChannelType, MessageType}`
- `gateway::GameType`
Diffstat (limited to 'src/model/gateway.rs')
| -rw-r--r-- | src/model/gateway.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/model/gateway.rs b/src/model/gateway.rs index 27a541b..c097c6f 100644 --- a/src/model/gateway.rs +++ b/src/model/gateway.rs @@ -192,6 +192,19 @@ enum_number!( } ); +impl GameType { + pub fn num(&self) -> u64 { + use self::GameType::*; + + match *self { + Playing => 0, + Streaming => 1, + Listening => 2, + Watching => 3, + } + } +} + impl Default for GameType { fn default() -> Self { GameType::Playing } } |