aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLakelezz <[email protected]>2018-10-09 02:22:49 +0200
committerGitHub <[email protected]>2018-10-09 02:22:49 +0200
commit093a1babec70fc331ec08ba14f23f1c14a08178f (patch)
treee2a3627f8c4bfcc06223b262e54f255596aa601b /src
parentA bunch of typo fixes (#404) (diff)
downloadserenity-093a1babec70fc331ec08ba14f23f1c14a08178f.tar.xz
serenity-093a1babec70fc331ec08ba14f23f1c14a08178f.zip
Simplify code by removing negation (#413)
Diffstat (limited to 'src')
-rw-r--r--src/framework/standard/mod.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs
index 7e99a0f..b0cebe7 100644
--- a/src/framework/standard/mod.rs
+++ b/src/framework/standard/mod.rs
@@ -1205,8 +1205,9 @@ impl Framework for StandardFramework {
#[cfg(feature = "cache")]
pub fn has_correct_permissions(command: &Arc<CommandOptions>, message: &Message) -> bool {
- if !command.required_permissions.is_empty() {
-
+ if command.required_permissions.is_empty() {
+ true
+ } else {
if let Some(guild) = message.guild() {
let perms = guild
.with(|g| g.permissions_in(message.channel_id, message.author.id));
@@ -1215,8 +1216,6 @@ pub fn has_correct_permissions(command: &Arc<CommandOptions>, message: &Message)
} else {
false
}
- } else {
- true
}
}