Skip to content

Commit

Permalink
add comment about return type inference
Browse files Browse the repository at this point in the history
  • Loading branch information
ph2734 committed Sep 11, 2011
2 parents e6a232a + 4f79a31 commit a935d1e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/scala/Example.scala
Expand Up @@ -2,7 +2,6 @@ package com.example

import unfiltered.request._
import unfiltered.response._
import util._
import org.clapper.avsl.Logger

/** unfiltered plan */
Expand All @@ -21,13 +20,13 @@ class Scalatra extends unfiltered.filter.Plan {
protected def executeRoutes(req: HttpRequest[_]):ResponseFunction[javax.servlet.http.HttpServletResponse] = {
//proper matching logic should come here, for now it's very simplistic
val handler = handlers.keys.filter(req.uri.startsWith(_))
//return type inference should come here
handler.headOption.map(handlers(_).asInstanceOf[ResponseFunction[javax.servlet.http.HttpServletResponse]]).getOrElse ( NotFound ~> ResponseString("could not find handler"))
}
val logger = Logger(classOf[App])

def intent = {
case req @ _ => _request.withValue(req) {
executeRoutes(req)
}
}
}
Expand Down

0 comments on commit a935d1e

Please sign in to comment.