diff options
| author | Austin Hellyer <[email protected]> | 2016-11-15 11:36:53 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-15 11:36:53 -0800 |
| commit | 5ccfaaa3b1a030b1fd0dcd364bdae001347d36e4 (patch) | |
| tree | 7cf531e4790109d6d7edd26bc5b483378d5ba5ac /src/ext | |
| parent | Embed Author: everything but 'name' is optional (diff) | |
| download | serenity-5ccfaaa3b1a030b1fd0dcd364bdae001347d36e4.tar.xz serenity-5ccfaaa3b1a030b1fd0dcd364bdae001347d36e4.zip | |
Add state/framework/etc. conditional compile flags
This adds conditional compilation for the following features, in
addition to the voice conditional compilation flag:
- extras (message builder)
- framework
- methods
- state
These 4 are enabled _by default_, while the `voice` feature flag is
disabled.
Disabling the state will allow incredibly low-memory bots.
Diffstat (limited to 'src/ext')
| -rw-r--r-- | src/ext/mod.rs | 9 | ||||
| -rw-r--r-- | src/ext/state/mod.rs | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/ext/mod.rs b/src/ext/mod.rs index bb87911..312074b 100644 --- a/src/ext/mod.rs +++ b/src/ext/mod.rs @@ -5,10 +5,17 @@ //! //! See each extension's module-level documentation for more information. //! +//! Note that the framework module requires the `framework` feature to be +//! enabled (enabled by default), the state requires the `state` feature to be +//! enabled (enabled by default), and voice support requires the `voice` feature +//! to be enabled (disabled by default). +//! //! [`Client`]: ../client/struct.Client.html //! [`Connection`]: ../client/struct.Connection.html +#[cfg(feature = "framework")] pub mod framework; +#[cfg(feature = "state")] pub mod state; -#[cfg(feature="voice")] +#[cfg(feature = "voice")] pub mod voice; diff --git a/src/ext/state/mod.rs b/src/ext/state/mod.rs index fa38b6f..5c56a54 100644 --- a/src/ext/state/mod.rs +++ b/src/ext/state/mod.rs @@ -166,7 +166,7 @@ impl State { self.update_with_guild_member_remove(event); }, Event::GuildMemberUpdate(ref event) => { - self.update_with_guild_member_update(event, false); + self.update_with_guild_member_update(event); }, Event::GuildMembersChunk(ref event) => { self.update_with_guild_members_chunk(event); @@ -448,10 +448,8 @@ impl State { } pub fn update_with_guild_member_update(&mut self, - event: &GuildMemberUpdateEvent, - old: bool) + event: &GuildMemberUpdateEvent) -> Option<Member> { - if let Some(guild) = self.guilds.get_mut(&event.guild_id) { let mut found = false; |