Skip to content

Commit cbf0c31

Browse files
authored
Apply suggestions from code review
1 parent 3b90d2b commit cbf0c31

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

models/issues/comment.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -201,21 +201,17 @@ const (
201201

202202
// HasRole returns if a role is not none
203203
func (r Role) HasRole() bool {
204-
return r.String() != ""
205-
}
206-
207-
func (r Role) String() string {
208-
return string(r)
204+
return r.Role != ""
209205
}
210206

211207
// LocaleString returns the locale string name of the Status
212208
func (r Role) LocaleString(lang translation.Locale) string {
213-
return lang.Tr("repo.issues.role." + r.String())
209+
return lang.Tr("repo.issues.role." + r.Role)
214210
}
215211

216212
// LocaleHelper returns the locale string name of the Status
217213
func (r Role) LocaleHelper(lang translation.Locale) string {
218-
return lang.Tr("repo.issues.role." + r.String() + "_helper")
214+
return lang.Tr("repo.issues.role." + r.Role + "_helper")
219215
}
220216

221217
// Comment represents a comment in commit and issue page.

0 commit comments

Comments
 (0)