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/model/utils.rs | |
| 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/model/utils.rs')
| -rw-r--r-- | src/model/utils.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/model/utils.rs b/src/model/utils.rs index f85a30f..92dfbd9 100644 --- a/src/model/utils.rs +++ b/src/model/utils.rs @@ -1,5 +1,4 @@ use std::collections::{BTreeMap, HashMap}; -use super::permissions::{self, Permissions}; use super::{ Channel, ChannelId, @@ -15,10 +14,14 @@ use super::{ UserId, VoiceState, }; -use ::client::STATE; use ::internal::prelude::*; use ::utils::{decode_array, into_array}; +#[cfg(feature = "methods")] +use super::permissions::{self, Permissions}; +#[cfg(feature = "methods")] +use ::client::STATE; + #[macro_escape] macro_rules! missing { (@ $name:expr, $json:ident, $value:expr) => { @@ -268,6 +271,7 @@ pub fn remove(map: &mut BTreeMap<String, Value>, key: &str) -> Result<Value> { } #[doc(hidden)] +#[cfg(feature="methods")] pub fn user_has_perms(channel_id: ChannelId, mut permissions: Permissions) -> Result<bool> { |