Skip to content

Commit

Permalink
Replace manual for loop with slices.Contains
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 committed Aug 29, 2024
1 parent ba3906d commit 47dd91b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions discord/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package discord

import (
"fmt"
"slices"
"strings"
"time"

Expand Down Expand Up @@ -155,12 +156,7 @@ func SplitScopes(joinedScopes string) []OAuth2Scope {
}

func HasScope(scope OAuth2Scope, scopes ...OAuth2Scope) bool {
for _, s := range scopes {
if s == scope {
return true
}
}
return false
return slices.Contains(scopes, scope)
}

type TokenType string
Expand Down

0 comments on commit 47dd91b

Please sign in to comment.