From bfb557644092f2478ccd5b82bf5be686f2819187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragutin=20Marjanovi=C4=87?= Date: Tue, 23 Apr 2024 16:18:33 +0200 Subject: [PATCH] Use 'project' for ZIO Config (#419) --- modules/example/src/main/scala/example/config/AppConfig.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/example/src/main/scala/example/config/AppConfig.scala b/modules/example/src/main/scala/example/config/AppConfig.scala index 937a9f133..1ea272f2e 100644 --- a/modules/example/src/main/scala/example/config/AppConfig.scala +++ b/modules/example/src/main/scala/example/config/AppConfig.scala @@ -22,8 +22,8 @@ import zio.{Config, Layer, ZIO, ZLayer} final case class AppConfig(http: HttpConfig, elasticsearch: ElasticsearchConfig) object AppConfig { - private[this] final val config = ZIO.config(deriveConfig[AppConfig]) + private[this] final val config = ZLayer(ZIO.config(deriveConfig[AppConfig])) lazy val live: Layer[Config.Error, ElasticsearchConfig with HttpConfig] = - ZLayer(config.map(_.elasticsearch)) ++ ZLayer(config.map(_.http)) + config.project(_.elasticsearch) ++ config.project(_.http) }