Skip to content

Commit

Permalink
Add json type alias for string
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeindykiewicz committed Jan 19, 2016
1 parent 080127e commit 87f7139
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -2,4 +2,5 @@ package com.blstream

package object sbtsearchmavenplugin {
type Error = String
type Json = String
}
4 changes: 2 additions & 2 deletions src/main/scala/com/blstream/sbtsearchmavenplugin/search.scala
Expand Up @@ -39,7 +39,7 @@ trait Search {

trait MavenOrgSearcher {

def query: String => Either[Error, String] =
def query: String => Either[Error, Json] =
queryString => {
val query = s"http://search.maven.org/solrsearch/select?q=$queryString&rows=20&wt=json"
val connMaybe = prepareConnection(query)
Expand Down Expand Up @@ -67,7 +67,7 @@ trait ResultsParser {
import net.liftweb.json._
implicit val formats = DefaultFormats

def parseResults: String => Either[Error, List[Artifact]] =
def parseResults: Json => Either[Error, List[Artifact]] =
results => {
val json = parse(results)
val suggestionsJson = json \ "spellcheck" \ "suggestions"
Expand Down

0 comments on commit 87f7139

Please sign in to comment.