Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ThisBuild / startYear := Some(2013)
val Scala213 = "2.13.16"

ThisBuild / scalaVersion := Scala213
ThisBuild / crossScalaVersions := Seq("2.12.20", Scala213, "3.3.6")
ThisBuild / crossScalaVersions := Seq("2.12.20", Scala213, "3.3.7")
ThisBuild / tlVersionIntroduced := Map("3" -> "3.0.3")

ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest")
Expand Down
1 change: 0 additions & 1 deletion core/shared/src/main/scala-3/fs2/ChunkPlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ package fs2
import scodec.bits.ByteVector

import scala.collection.immutable.ArraySeq
import scala.collection.immutable
import scala.reflect.ClassTag

private[fs2] trait ChunkPlatform[+O] extends Chunk213And3Compat[O] {
Expand Down
1 change: 1 addition & 0 deletions core/shared/src/main/scala/fs2/Stream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3816,6 +3816,7 @@ object Stream extends StreamLowPriority {
* are dequeued and emitted as a single chunk.
*/
@nowarn("msg=never used")
@nowarn3("msg=unused implicit parameter")
def fromQueueNoneTerminated[F[_]: Functor, A](
queue: QueueSource[F, Option[A]],
limit: Int = Int.MaxValue
Expand Down
5 changes: 0 additions & 5 deletions integration/src/test/scala/fs2/MemoryLeakSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,11 @@ class MemoryLeakSpec extends FunSuite {

leakTest("constant eval") {
var cnt = 0
var start = System.currentTimeMillis
Stream
.constant(())
.flatMap { _ =>
Stream.eval(IO {
cnt = (cnt + 1) % 1000000
if (cnt == 0) {
val now = System.currentTimeMillis
start = now
}
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion io/js/src/main/scala/fs2/io/internal/facade/net.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private[io] object net {
@js.native
class Socket extends fs2.io.Duplex {

def this(options: SocketOptions) = this()
def this(@unused options: SocketOptions) = this()

def connect(path: String, connectListener: js.Function0[Unit]): Socket = js.native

Expand Down
2 changes: 1 addition & 1 deletion io/js/src/main/scala/fs2/io/internal/facade/tls.scala
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private[io] object tls {
@js.native
class TLSSocket extends Socket {

def this(socket: fs2.io.Duplex, options: TLSSocketOptions) = this()
def this(@unused socket: fs2.io.Duplex, @unused options: TLSSocketOptions) = this()

def alpnProtocol: String | Boolean = js.native

Expand Down
9 changes: 4 additions & 5 deletions io/js/src/main/scala/fs2/io/ioplatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ import fs2.io.internal.facade

import java.nio.charset.Charset
import java.nio.charset.StandardCharsets
import scala.annotation.nowarn
import scala.scalajs.js
import scala.scalajs.js.typedarray.Uint8Array

import org.typelevel.scalaccompat.annotation._

private[fs2] trait ioplatform {

@deprecated("Use suspendReadableAndRead instead", "3.1.4")
Expand Down Expand Up @@ -423,8 +424,7 @@ private[fs2] trait ioplatform {
/** Stream of bytes read asynchronously from standard input.
* Takes a dummy `Int` parameter for source-compatibility with JVM.
*/
@nowarn("msg=never used")
def stdin[F[_]: Async](ignored: Int): Stream[F, Byte] = stdin
def stdin[F[_]: Async](@unused ignored: Int): Stream[F, Byte] = stdin

/** Pipe of bytes that writes emitted values to standard output asynchronously. */
def stdout[F[_]: Async]: Pipe[F, Byte, Nothing] = stdoutAsync
Expand All @@ -451,8 +451,7 @@ private[fs2] trait ioplatform {
/** Stream of `String` read asynchronously from standard input decoded in UTF-8.
* Takes a dummy `Int` parameter for source-compatibility with JVM.
*/
@nowarn("msg=never used")
def stdinUtf8[F[_]: Async](ignored: Int): Stream[F, String] =
def stdinUtf8[F[_]: Async](@unused ignored: Int): Stream[F, String] =
stdinAsync.through(text.utf8.decode)

// Copied JVM implementations, for bincompat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ private[net] object AsynchronousDatagramSocketGroup {

onSelectorThread {
val channel = key.channel.asInstanceOf[DatagramChannel]
var cancelReader: () => Unit = null
if (attachment.hasReaders) {
cancelReader = attachment.queueReader(readerId, cb)
attachment.queueReader(readerId, cb)
()
} else if (!read1(channel, cb)) {
cancelReader = attachment.queueReader(readerId, cb)
attachment.queueReader(readerId, cb)
try {
key.interestOps(key.interestOps | SelectionKey.OP_READ); ()
} catch {
Expand Down Expand Up @@ -239,11 +239,10 @@ private[net] object AsynchronousDatagramSocketGroup {
val attachment = key.attachment.asInstanceOf[Attachment]
onSelectorThread {
val channel = key.channel.asInstanceOf[DatagramChannel]
var cancelWriter: () => Unit = null
if (attachment.hasWriters) {
cancelWriter = attachment.queueWriter(writerId, (writerDatagram, cb))
attachment.queueWriter(writerId, (writerDatagram, cb))
()
} else if (!write1(channel, writerDatagram, cb)) {
cancelWriter = attachment.queueWriter(writerId, (writerDatagram, cb))
try {
key.interestOps(key.interestOps | SelectionKey.OP_WRITE); ()
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
package fs2.protocols
package ip

import scodec.bits._
import scodec.bits.*
import scodec.{Codec, SizeBound}
import scodec.codecs._
import scodec.compat._
import fs2.interop.scodec._
import scodec.codecs.*
import fs2.interop.scodec.*
import fs2.protocols.ethernet.{EtherType, EthernetFrameHeader}
import com.comcast.ip4s.Ipv4Address
import org.typelevel.scalaccompat.annotation.*

/** IPv4 header. */
case class Ipv4Header(
Expand All @@ -43,7 +43,9 @@ case class Ipv4Header(
options: BitVector
) extends UnsealedIpHeader

@nowarn3("msg=unused import")
object Ipv4Header {
import scodec.compat.*

implicit val codec: Codec[Ipv4Header] = {
// format: off
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

package fs2.protocols.mpeg

import scodec.bits._
import scodec.bits.*
import scodec.Codec
import scodec.codecs._
import scodec.compat._
import scodec.codecs.*
import org.typelevel.scalaccompat.annotation.*

sealed abstract class PesScramblingControl
object PesScramblingControl {
Expand Down Expand Up @@ -61,7 +61,9 @@ case class PesPacketHeader(
extension: Option[PesPacketHeader.Extension]
)

@nowarn3("msg=unused import")
object PesPacketHeader {
import scodec.compat.*

case class Flags(
ptsFlag: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ package transport

import scodec.{Attempt, Codec, DecodeResult, SizeBound}
import scodec.bits.BitVector
import scodec.codecs._
import scodec.compat._
import scodec.codecs.*
import org.typelevel.scalaccompat.annotation.*

/** Partial modelling of the adaptation field.
* The field extension, if present, is ignored upon decoding.
Expand All @@ -40,7 +40,9 @@ case class AdaptationField(
transportPrivateData: Option[BitVector]
)

@nowarn3("msg=unused import")
object AdaptationField {
import scodec.compat.*

final val Empty: AdaptationField = AdaptationField(None, None, None, None, None)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import cats.effect.kernel._
import cats.effect.std.Dispatcher

import org.reactivestreams._
import org.typelevel.scalaccompat.annotation._

import scala.util.control.NoStackTrace

Expand All @@ -49,7 +50,7 @@ final class StreamUnicastPublisher[F[_]: Async, A](
private[reactivestreams] def this(
stream: Stream[F, A],
startDispatcher: Dispatcher[F],
requestDispatcher: Dispatcher[F]
@unused requestDispatcher: Dispatcher[F]
) =
this(stream, startDispatcher)

Expand Down