Skip to content

Commit

Permalink
Remove option usage
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergrabinski committed Apr 2, 2024
1 parent 224a0b2 commit ec25ede
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ trait ProjectMapper {

object ProjectMapper {

def apply(projectMapping: Option[ProjectMapping]): ProjectMapper =
def apply(projectMapping: ProjectMapping): ProjectMapper =
(project: ProjectRef) =>
projectMapping match {
case Some(mapping) => mapping.getOrElse(project, project)
case None => project
case m if m.isEmpty => project
case mapping => mapping.getOrElse(project, project)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final case class ShipConfig(
database: DatabaseConfig,
eventLog: EventLogConfig,
organizations: OrganizationCreationConfig,
projectMapping: Option[ProjectMapping],
projectMapping: ProjectMapping = Map.empty,
serviceAccount: ServiceAccountConfig
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ShipConfigSuite extends NexusSuite {
for {
externalConfigPath <- loader.absolutePath("config/project-mapping.conf")
mapping = ShipConfig.load(Some(Path(externalConfigPath))).map(_.projectMapping)
_ <- mapping.assertEquals(Some(expected))
_ <- mapping.assertEquals(expected)
} yield ()
}

Expand Down

0 comments on commit ec25ede

Please sign in to comment.