Skip to content

Commit

Permalink
Update to use Map.newBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherDavenport committed Jul 10, 2023
1 parent d542685 commit d84f7b9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.8, 3.3.0]
scala: [2.13.11, 3.3.0]
java: [temurin@8]
project: [rootJS, rootJVM]
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -143,22 +143,22 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.13.8, rootJS)
- name: Download target directories (2.13.11, rootJS)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJS
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11-rootJS

- name: Inflate target directories (2.13.8, rootJS)
- name: Inflate target directories (2.13.11, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.8, rootJVM)
- name: Download target directories (2.13.11, rootJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11-rootJVM

- name: Inflate target directories (2.13.8, rootJVM)
- name: Inflate target directories (2.13.11, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ThisBuild / tlSonatypeUseLegacyHost := true

val Scala3 = "3.3.0"

ThisBuild / crossScalaVersions := Seq("2.13.8", Scala3)
ThisBuild / crossScalaVersions := Seq("2.13.11", Scala3)
ThisBuild / scalaVersion := Scala3

ThisBuild / testFrameworks += new TestFramework("munit.Framework")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import cats.effect.syntax.all._
import cats.data.{Kleisli, OptionT}
import org.typelevel.log4cats.{StructuredLogger, SelfAwareStructuredLogger}
import org.typelevel.log4cats.extras.LogLevel
import scala.collection.immutable.MapBuilderImpl
import org.http4s.client.RequestKey
import cats.effect.kernel.Outcome.Canceled
import cats.effect.kernel.Outcome.Errored
Expand Down Expand Up @@ -330,7 +329,7 @@ object ClientMiddleware {
}

private def request[F[_]](request: Request[Pure], headers: Set[CIString], routeClassifier: Request[Pure] => Option[String], includeUrl: Request[Pure] => Boolean, additionalRequestContext: Request[Pure] => Map[String, String]): Map[String, String] = {
val builder = MapBuilderImpl[String, String]()
val builder = Map.newBuilder[String, String]
builder += HttpStructuredContext.Common.method(request.method)
if (includeUrl(request)) {
builder += HttpStructuredContext.Common.url(request.uri)
Expand Down Expand Up @@ -382,7 +381,7 @@ object ClientMiddleware {
}

def response[F[_]](response: Response[Pure], headers: Set[CIString], responseAdditionalContext: Response[Pure] => Map[String, String]): Map[String, String] = {
val builder = MapBuilderImpl[String, String]()
val builder = Map.newBuilder[String, String]

builder += HttpStructuredContext.Common.status(response.status)
response.contentLength.foreach(l =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import cats.effect.syntax.all._
import cats.data.{Kleisli, OptionT}
import org.typelevel.log4cats.{StructuredLogger, SelfAwareStructuredLogger}
import org.typelevel.log4cats.extras.LogLevel
import scala.collection.immutable.MapBuilderImpl
import org.http4s.client.RequestKey
import cats.effect.kernel.Outcome.Canceled
import cats.effect.kernel.Outcome.Errored
Expand Down Expand Up @@ -516,7 +515,7 @@ object ServerMiddleware {
}

private def request[F[_]](request: Request[Pure], headers: Set[CIString], routeClassifier: Request[Pure] => Option[String], includeUrl: Request[Pure] => Boolean, additionalRequestContext: Request[Pure] => Map[String, String]): Map[String, String] = {
val builder = MapBuilderImpl[String, String]()
val builder = Map.newBuilder[String, String]
builder += HttpStructuredContext.Common.method(request.method)
if (includeUrl(request)) {
builder += HttpStructuredContext.Common.url(request.uri)
Expand Down Expand Up @@ -565,7 +564,7 @@ object ServerMiddleware {
}

def response[F[_]](response: Response[Pure], headers: Set[CIString], responseAdditionalContext: Response[Pure] => Map[String, String]): Map[String, String] = {
val builder = MapBuilderImpl[String, String]()
val builder = Map.newBuilder[String, String]

builder += HttpStructuredContext.Common.status(response.status)
response.contentLength.foreach(l =>
Expand Down

0 comments on commit d84f7b9

Please sign in to comment.