From f962297ad7500aeab06a103d23b794af5324a3da Mon Sep 17 00:00:00 2001 From: Adam Fraser Date: Thu, 12 Oct 2023 06:47:54 -0700 Subject: [PATCH] Remove Unnecessary Dependency (#2477) * remove unnecessary dependency * fix compilation errors * format * fix tests * format --- project/plugins.sbt | 1 - zio-http/src/main/scala/zio/http/Header.scala | 2 +- zio-http/src/main/scala/zio/http/Path.scala | 2 +- .../main/scala/zio/http/netty/client/NettyClientDriver.scala | 2 +- zio-http/src/test/scala/zio/http/FormSpec.scala | 5 +++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 0882f2c22c..837a8921d5 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,7 +4,6 @@ addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.6") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.3") addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0") addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.17.0") -addSbtPlugin("ch.epfl.scala" % "sbt-scala3-migrate" % "0.6.1") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") diff --git a/zio-http/src/main/scala/zio/http/Header.scala b/zio-http/src/main/scala/zio/http/Header.scala index bfd2bf6b9d..e47b3476a2 100644 --- a/zio-http/src/main/scala/zio/http/Header.scala +++ b/zio-http/src/main/scala/zio/http/Header.scala @@ -4325,7 +4325,7 @@ object Header { def parse(value: String): Either[String, WWWAuthenticate] = Try { - val challengeRegEx(scheme, challenge) = value + val challengeRegEx(scheme, challenge) = value: @unchecked val params = auth .findAllMatchIn(challenge) .map { m => diff --git a/zio-http/src/main/scala/zio/http/Path.scala b/zio-http/src/main/scala/zio/http/Path.scala index f362d42e4c..81c7f4f68a 100644 --- a/zio-http/src/main/scala/zio/http/Path.scala +++ b/zio-http/src/main/scala/zio/http/Path.scala @@ -26,7 +26,7 @@ import zio.{Chunk, ChunkBuilder} * whether there are leading and trailing slashes in the path. This allows for a * combination of precision and performance and supports a rich API. */ -final case class Path private (flags: Path.Flags, segments: Chunk[String]) { self => +final case class Path private[http] (flags: Path.Flags, segments: Chunk[String]) { self => import Path.{Flag, Flags} /** diff --git a/zio-http/src/main/scala/zio/http/netty/client/NettyClientDriver.scala b/zio-http/src/main/scala/zio/http/netty/client/NettyClientDriver.scala index 4f7a863968..bd6da32226 100644 --- a/zio-http/src/main/scala/zio/http/netty/client/NettyClientDriver.scala +++ b/zio-http/src/main/scala/zio/http/netty/client/NettyClientDriver.scala @@ -31,7 +31,7 @@ import io.netty.channel.{Channel, ChannelFactory, ChannelHandler, EventLoopGroup import io.netty.handler.codec.http.websocketx.{WebSocketClientProtocolHandler, WebSocketFrame => JWebSocketFrame} import io.netty.handler.codec.http.{FullHttpRequest, HttpObjectAggregator} -final case class NettyClientDriver private ( +final case class NettyClientDriver private[netty] ( channelFactory: ChannelFactory[Channel], eventLoopGroup: EventLoopGroup, nettyRuntime: NettyRuntime, diff --git a/zio-http/src/test/scala/zio/http/FormSpec.scala b/zio-http/src/test/scala/zio/http/FormSpec.scala index e66b7290c8..5c9c05fa1e 100644 --- a/zio-http/src/test/scala/zio/http/FormSpec.scala +++ b/zio-http/src/test/scala/zio/http/FormSpec.scala @@ -116,7 +116,8 @@ object FormSpec extends ZIOHttpSpec { form <- Form.fromMultipartBytes(multipartFormBytes1) encoding = form.multipartBytes(boundary) bytes <- encoding.runCollect - (text: FormField.Text) :: (image1: FormField.Binary) :: (image2: FormField.Binary) :: Nil = form.formData.toList + (text: FormField.Text) :: (image1: FormField.Binary) :: (image2: FormField.Binary) :: Nil = + form.formData.toList: @unchecked } yield assert(bytes)(equalTo(multipartFormBytes1)) && assert(form.formData.size)(equalTo(3)) && assert(text.name)(equalTo("submit-name")) && @@ -197,7 +198,7 @@ object FormSpec extends ZIOHttpSpec { .runCollect .map { formData => val (text: FormField.Text) :: (image1: FormField.Binary) :: (image2: FormField.Binary) :: Nil = - formData.toList + formData.toList: @unchecked assert(formData.size)(equalTo(3)) && assert(text.name)(equalTo("submit-name")) && assert(text.value)(equalTo("Larry")) &&