From 271fdd4731e469dc71bff1646338912883c8f466 Mon Sep 17 00:00:00 2001 From: Sandeep Dasika Date: Sat, 9 Nov 2024 09:11:43 +0530 Subject: [PATCH] Use Future.successful wherever possible --- modules/client/src/main/scala/PlaySearchClient.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/client/src/main/scala/PlaySearchClient.scala b/modules/client/src/main/scala/PlaySearchClient.scala index 4736b623..4c388427 100644 --- a/modules/client/src/main/scala/PlaySearchClient.scala +++ b/modules/client/src/main/scala/PlaySearchClient.scala @@ -67,7 +67,7 @@ class PlaySearchClient(client: StandaloneWSClient, baseUrl: String)(using Execut .url(url) .post(data) .flatMap: - case res if res.status == 200 => Future(res.body[R]) + case res if res.status == 200 => Future.successful(res.body[R]) case res if res.status == 400 => Future.failed(SearchError.BadRequest(s"$url ${res.status} ${res.body}")) case res => Future.failed(SearchError.InternalServerError(s"$url ${res.status} ${res.body}")) @@ -79,7 +79,7 @@ class PlaySearchClient(client: StandaloneWSClient, baseUrl: String)(using Execut .url(url) .post(data) .flatMap: - case res if res.status == 200 => Future(()) + case res if res.status == 200 => Future.successful(()) case res if res.status == 400 => Future.failed(SearchError.BadRequest(s"$url ${res.status} ${res.body}")) case res => Future.failed(SearchError.InternalServerError(s"$url ${res.status} ${res.body}")) @@ -90,7 +90,7 @@ class PlaySearchClient(client: StandaloneWSClient, baseUrl: String)(using Execut .url(url) .execute("POST") .flatMap: - case res if res.status == 200 => Future(()) + case res if res.status == 200 => Future.successful(()) case res if res.status == 400 => Future.failed(SearchError.BadRequest(s"$url ${res.status} ${res.body}")) case res => Future.failed(SearchError.InternalServerError(s"$url ${res.status} ${res.body}"))