diff --git a/Package.swift b/Package.swift index 266b709..8d1c68b 100644 --- a/Package.swift +++ b/Package.swift @@ -3,10 +3,10 @@ import PackageDescription let package = Package( name: "Slimane", dependencies: [ - .Package(url: "https://github.com/slimane-swift/Middleware.git", majorVersion: 0, minor: 2), - .Package(url: "https://github.com/slimane-swift/Skelton.git", majorVersion: 0, minor: 4), + .Package(url: "https://github.com/slimane-swift/Middleware.git", majorVersion: 0, minor: 3), + .Package(url: "https://github.com/slimane-swift/Skelton.git", majorVersion: 0, minor: 5), .Package(url: "https://github.com/slimane-swift/Time.git", majorVersion: 0, minor: 2), - .Package(url: "https://github.com/slimane-swift/POSIXRegex.git", majorVersion: 0, minor: 6), - .Package(url: "https://github.com/slimane-swift/AsyncResponderConvertible.git", majorVersion: 0, minor: 2), + .Package(url: "https://github.com/slimane-swift/POSIXRegex.git", majorVersion: 0, minor: 7), + .Package(url: "https://github.com/slimane-swift/AsyncResponderConvertible.git", majorVersion: 0, minor: 3), ] ) diff --git a/Sources/AsyncRoute.swift b/Sources/AsyncRoute.swift index 3b72693..4bf212d 100644 --- a/Sources/AsyncRoute.swift +++ b/Sources/AsyncRoute.swift @@ -17,7 +17,7 @@ public protocol AsyncRoute: AsyncResponder { } extension AsyncRoute { - public func respond(to request: Request, result: (Void throws -> Response) -> Void) { + public func respond(to request: Request, result: ((Void) throws -> Response) -> Void) { result { Response(status: .ok) } diff --git a/Sources/AsyncRouter.swift b/Sources/AsyncRouter.swift index efce5de..37b192a 100644 --- a/Sources/AsyncRouter.swift +++ b/Sources/AsyncRouter.swift @@ -27,7 +27,7 @@ public struct Router: AsyncRouter { self.respond = respond } - public func respond(to request: Request, result: (Void throws -> Response) -> Void) { + public func respond(to request: Request, result: ((Void) throws -> Response) -> Void) { return self.respond(to: request, result: result) } diff --git a/Sources/Slimane+Server.swift b/Sources/Slimane+Server.swift index c2ea1aa..5750838 100644 --- a/Sources/Slimane+Server.swift +++ b/Sources/Slimane+Server.swift @@ -7,8 +7,8 @@ // extension Slimane { - public func listen(loop: Loop = Loop.defaultLoop, host: String = "0.0.0.0", port: Int = 3000, errorHandler: ErrorProtocol -> () = { _ in }) throws { - var server = HTTPServer(loop: loop, ipcEnable: Cluster.isWorker) { [unowned self] in + public func listen(loop: Loop = Loop.defaultLoop, host: String = "0.0.0.0", port: Int = 3000, errorHandler: (ErrorProtocol) -> () = { _ in }) throws { + let server = HTTPServer(loop: loop, ipcEnable: Cluster.isWorker) { [unowned self] in do { let (request, stream) = try $0() self.dispatch(request, stream: stream) diff --git a/Sources/Slimane.swift b/Sources/Slimane.swift index 2c9aab3..9c967ab 100644 --- a/Sources/Slimane.swift +++ b/Sources/Slimane.swift @@ -24,7 +24,7 @@ public class Slimane { public var backlog: UInt = 1024 - public var errorHandler: ErrorProtocol -> Response = defaultErrorHandler + public var errorHandler: (ErrorProtocol) -> Response = defaultErrorHandler // TODO This is interim measures for handle streaming response // untill https://github.com/open-swift/S4/pull/52 get merged.