Skip to content

Commit

Permalink
Simplify code by removing negation (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakelezz committed Oct 9, 2018
1 parent 9865d9c commit 093a1ba
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/framework/standard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -1215,8 +1216,6 @@ pub fn has_correct_permissions(command: &Arc<CommandOptions>, message: &Message)
} else {
false
}
} else {
true
}
}

Expand Down

0 comments on commit 093a1ba

Please sign in to comment.