Skip to content

Commit edbb248

Browse files
committed
fix warnings
1 parent cfb582c commit edbb248

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

curl/src/main/scala/org/http4s/curl/internal/CurlEasy.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ import scala.scalanative.unsigned._
2828
final private[curl] class CurlEasy private (val curl: Ptr[CURL], errBuffer: Ptr[CChar]) {
2929

3030
// GC rooting for CFuncPtr wrappers — prevents Scala Native GC from collecting them
31+
// These are intentionally write-only: they keep callback references alive on the heap.
32+
@annotation.nowarn("msg=(never used|unused)")
3133
private var _headerCallback: Any = null
34+
@annotation.nowarn("msg=(never used|unused)")
3235
private var _writeCallback: Any = null
36+
@annotation.nowarn("msg=(never used|unused)")
3337
private var _readCallback: Any = null
3438

3539
@inline private def throwOnError(thunk: => CURLcode): Unit = {

curl/src/main/scala/org/http4s/curl/unsafe/CurlExecutorScheduler.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ final class CurlExecutorScheduler(
4040
private[this] var needsReschedule: Boolean = true
4141
private[this] val executeQueue: ArrayDeque[Runnable] = new ArrayDeque
4242
private[this] val sleepQueue: PriorityQueue[SleepTask] = new PriorityQueue
43-
private[this] val callbacks
44-
: mutable.Map[Ptr[libcurl.CURL], Either[Throwable, Unit] => Unit] = mutable.Map.empty
43+
private[this] val callbacks: mutable.Map[Ptr[libcurl.CURL], Either[Throwable, Unit] => Unit] =
44+
mutable.Map.empty
4545
private[this] val noop: Runnable = () => ()
4646

4747
// ExecutionContext
@@ -184,7 +184,7 @@ final class CurlExecutorScheduler(
184184
IO(callbacks.remove(handle).foreach(_(Right(()))))
185185
}
186186

187-
private[this] final class SleepTask(val at: Long, val runnable: Runnable)
187+
final private[this] class SleepTask(val at: Long, val runnable: Runnable)
188188
extends Runnable
189189
with Comparable[SleepTask] {
190190
def run(): Unit = { sleepQueue.remove(this); () }

curl/src/main/scala/org/http4s/curl/unsafe/CurlRuntime.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ object CurlRuntime {
5353
if (_global == null) {
5454
installGlobal {
5555
CurlRuntime()
56-
}
56+
}: Unit
5757
}
5858

5959
_global

tests/http/src/test/scala/CurlClientSuite.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import cats.effect.SyncIO
2121
import cats.effect.kernel.Resource
2222
import cats.effect.std.Random
2323
import cats.effect.unsafe.IORuntime
24-
import cats.syntax.all._
2524
import munit.CatsEffectSuite
2625
import org.http4s.Method._
2726
import org.http4s.Request

0 commit comments

Comments
 (0)