Skip to content

Commit b7897f3

Browse files
committed
Use type for issue state
* src/main/scala/codecheck/github/models/Issue.scala (state): Use IssueState.fromString to lift type from string. * src/main/scala/codecheck/github/models/PullRequest.scala (state): IssueState.fromString to lift type from string.
1 parent 5bbb19f commit b7897f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/scala/codecheck/github/models/Issue.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ case class Issue(value: JValue) extends AbstractJson(value) {
172172
case _ => Nil
173173
}
174174

175-
def state = get("state")
175+
def state = IssueState.fromString(get("state"))
176176
def locked = boolean("locked")
177177

178178
lazy val assignee = objectOpt("assignee")(v => User(v))

src/main/scala/codecheck/github/models/PullRequest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ case class PullRequestRef(value: JValue) extends AbstractJson(value) {
5757
case class PullRequest(value: JValue) extends AbstractJson(value) {
5858
def number = get("number").toLong
5959
def body = get("body")
60-
def state = get("state")
60+
def state = IssueState.fromString(get("state"))
6161
def title = get("title")
6262
lazy val head = PullRequestRef(value \ "head")
6363
lazy val base = PullRequestRef(value \ "base")

0 commit comments

Comments
 (0)