diff options
| author | Austin Hellyer <[email protected]> | 2016-11-24 14:30:22 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-24 14:30:22 -0800 |
| commit | 6331fb5f2de580d9ba8c6de00c98032e4db5d984 (patch) | |
| tree | 38eb7e6dd56eb175bdac0d9202613dfd42558777 /src/model/utils.rs | |
| parent | Rename guild structs to Guild and PartialGuild (diff) | |
| download | serenity-6331fb5f2de580d9ba8c6de00c98032e4db5d984.tar.xz serenity-6331fb5f2de580d9ba8c6de00c98032e4db5d984.zip | |
Allow compiling with only either cache or methods
Some of the methods relied on the cache being present. Now, these
methods only conditionally require the cache to be compiled and
present.
The cache was mainly used for checking if the current user had
permission to perform operations.
Diffstat (limited to 'src/model/utils.rs')
| -rw-r--r-- | src/model/utils.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/model/utils.rs b/src/model/utils.rs index d6a4cc8..a995758 100644 --- a/src/model/utils.rs +++ b/src/model/utils.rs @@ -302,6 +302,13 @@ pub fn user_has_perms(channel_id: ChannelId, Ok(permissions.is_empty()) } +#[doc(hidden)] +#[cfg(all(not(feature = "cache"), feature = "methods"))] +pub fn user_has_perms(channel_id: ChannelId, mut permissions: Permissions) + -> Result<bool> { + Ok(true) +} + pub fn warn_field(name: &str, map: BTreeMap<String, Value>) { if !map.is_empty() { debug!("Unhandled keys: {} has {:?}", name, Value::Object(map)) |