Skip to content

Commit

Permalink
style: fix Allow letter to =>, -> (example)
Browse files Browse the repository at this point in the history
  • Loading branch information
Javakky-pxv committed Nov 21, 2022
1 parent 5a866d1 commit aad7dbf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/app/controllers/AsyncController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exec: ExecutionContext) extends AbstractController(components) {
* a path of `/message`.
*/
def message: Action[AnyContent] = Action.async {
getFutureMessage(1.second).map { msg Ok(Json.toJson(msg)) }
getFutureMessage(1.second).map { msg => Ok(Json.toJson(msg)) }
}

private def getFutureMessage(delayTime: FiniteDuration): Future[Message] = {
Expand Down
4 changes: 2 additions & 2 deletions example/app/filters/ExampleFilter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class ExampleFilter @Inject() (
exec: ExecutionContext
) extends Filter {

override def apply(nextFilter: RequestHeader Future[Result])(requestHeader: RequestHeader): Future[Result] = {
override def apply(nextFilter: RequestHeader => Future[Result])(requestHeader: RequestHeader): Future[Result] = {
// Run the next filter in the chain. This will call other filters
// and eventually call the action. Take the result and modify it
// by adding a new header.
nextFilter(requestHeader).map { result
nextFilter(requestHeader).map { result =>
result.withHeaders("X-ExampleFilter" -> "foo")
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/app/services/ApplicationTimer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ApplicationTimer @Inject() (clock: Clock, appLifecycle: ApplicationLifecyc
// When the application starts, register a stop hook with the
// ApplicationLifecycle object. The code inside the stop hook will
// be run when the application stops.
appLifecycle.addStopHook { ()
appLifecycle.addStopHook { () =>
val stop: Instant = clock.instant
val runningTime: Long = stop.getEpochSecond - start.getEpochSecond
logger.info(s"ApplicationTimer demo: Stopping application at ${clock.instant} after ${runningTime}s.")
Expand Down

0 comments on commit aad7dbf

Please sign in to comment.