Skip to content

Commit

Permalink
Use new given syntax as the old one givig warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Dec 15, 2024
1 parent ac3aa06 commit d7e7bc2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion modules/app/src/main/scala/http.server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object MkHttpServer:

def apply()(using server: MkHttpServer): MkHttpServer = server

given forAsyncLogger(using Logger[IO]): MkHttpServer = new:
given Logger[IO] => MkHttpServer = new:

def newEmber(cfg: HttpServerConfig, httpApp: HttpApp[IO]): Resource[IO, Server] = EmberServerBuilder
.default[IO]
Expand Down
2 changes: 1 addition & 1 deletion modules/app/src/main/scala/service.search.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ object SearchServiceImpl:
given dateRange: Transformer.Derived[DateRange, Range[Instant]] =
Transformer.Derived.FromFunction(r => Range(r.a.map(_.to[Instant]), r.b.map(_.to[Instant])))

given Queryable[Query] with
given Queryable[Query]:
def searchDef(query: Query)(from: From, size: Size) =
query match
case q: Query.Forum => q.to[Forum].searchDef(from, size)
Expand Down
4 changes: 2 additions & 2 deletions modules/client/src/main/scala/PlaySearchClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ object implicits:
Query.schema.required[SearchInput]("query", _.query)
)(SearchInput.apply)

given [A](using JsonCodec[A]): BodyWritable[A] =
given [A] => JsonCodec[A] => BodyWritable[A] =
BodyWritable(a => InMemoryBody(ByteString.fromArrayUnsafe(writeToArray(a))), "application/json")

given [A](using JsonCodec[A]): BodyReadable[A] =
given [A] => JsonCodec[A] => BodyReadable[A] =
BodyReadable(res => readFromArray(res.bodyAsBytes.toArray))

def apply(client: StandaloneWSClient, url: String)(using ExecutionContext): SearchService[Future] =
Expand Down
2 changes: 1 addition & 1 deletion modules/elastic/src/main/scala/ESClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object ESClient:
)
)

def apply[F[_]: MonadCancelThrow: Functor: Executor](client: ElasticClient, baseAttributes: Attributes)(
def apply[F[_]: {MonadCancelThrow, Functor, Executor}](client: ElasticClient, baseAttributes: Attributes)(
metric: Histogram[F, Double]
) = new ESClient[F]:

Expand Down
2 changes: 1 addition & 1 deletion modules/ingestor/src/main/scala/Repo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object Repo:

type MongoCollection = GenericMongoCollection[IO, Document, [A] =>> fs2.Stream[IO, A]]

given [A]: HasDocId[ChangeStreamDocument[A]] with
given [A] => HasDocId[ChangeStreamDocument[A]] :
extension (change: ChangeStreamDocument[A])
def docId: Option[String] =
change.documentKey.flatMap(_.id)
Expand Down
2 changes: 1 addition & 1 deletion modules/ingestor/src/main/scala/ingestor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait Ingestor:

object Ingestor:

given [A: Schema]: Indexable[A] = (a: A) => writeToString(a)
given [A] => Schema[A] => Indexable[A] = a => writeToString(a)

def apply[A: Schema](
index: Index,
Expand Down

0 comments on commit d7e7bc2

Please sign in to comment.