summaryrefslogtreecommitdiff
path: root/cask/src/cask/main/Decorators.scala
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-08-18 11:10:33 +0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-08-18 11:10:33 +0800
commit1440ae9010e6615e83ee44d8d74d9708a568b07b (patch)
tree4b49c72c60f38fefdb020f9ec1d58670624b769e /cask/src/cask/main/Decorators.scala
parent4b0cfdf0eeca46cfccbf9fe42af42f383932c427 (diff)
downloadcask-1440ae9010e6615e83ee44d8d74d9708a568b07b.tar.gz
cask-1440ae9010e6615e83ee44d8d74d9708a568b07b.tar.bz2
cask-1440ae9010e6615e83ee44d8d74d9708a568b07b.zip
Get rid of unneccessary `HttpDecorator`
Diffstat (limited to 'cask/src/cask/main/Decorators.scala')
-rw-r--r--cask/src/cask/main/Decorators.scala11
1 files changed, 5 insertions, 6 deletions
diff --git a/cask/src/cask/main/Decorators.scala b/cask/src/cask/main/Decorators.scala
index 0515232..7aa361f 100644
--- a/cask/src/cask/main/Decorators.scala
+++ b/cask/src/cask/main/Decorators.scala
@@ -5,7 +5,9 @@ import cask.internal.Router.ArgReader
import cask.model.{Request, Response}
-trait Endpoint extends BaseEndpoint with HttpDecorator
+trait Endpoint extends BaseEndpoint {
+ type Returned = Router.Result[Response]
+}
/**
* Used to annotate a single Cask endpoint function; similar to a [[Decorator]]
* but with additional metadata and capabilities.
@@ -51,9 +53,6 @@ trait BaseDecorator{
def wrapFunction(ctx: Request, delegate: Delegate): Returned
def getParamParser[T](implicit p: InputParser[T]) = p
}
-trait HttpDecorator extends BaseDecorator{
- type Returned = Router.Result[Response]
-}
/**
* A decorator allows you to annotate a function to wrap it, via
@@ -66,8 +65,8 @@ trait HttpDecorator extends BaseDecorator{
* to `wrapFunction`, which takes a `Map` representing any additional argument
* lists (if any).
*/
-trait Decorator extends HttpDecorator {
-
+trait Decorator extends BaseDecorator{
+ type Returned = Router.Result[Response]
type Input = Any
type Output = Response
type InputParser[T] = NoOpParser[Input, T]