Skip to content

Commit

Permalink
Upgrade ZIO to 1.0.0 (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
mijicd authored Aug 4, 2020
1 parent e0e4990 commit d6e06d7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version = "2.6.4"

align = most
align.preset = most
assumeStandardLibraryStripMargin = true
danglingParentheses = true
danglingParentheses.preset = true
docstrings = JavaDoc
lineEndings = unix
maxColumn = 120
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class AsynchronousSocketChannel(private val channel: JAsynchronousSocketChannel)
effectAsyncWithCompletionHandler[JInteger] { h =>
channel.read(
dst.buffer.asInstanceOf[JByteBuffer],
timeout.fold(Long.MaxValue, _.nanos),
timeout.fold(Long.MaxValue, _.toNanos),
TimeUnit.NANOSECONDS,
(),
h
Expand Down Expand Up @@ -197,7 +197,7 @@ class AsynchronousSocketChannel(private val channel: JAsynchronousSocketChannel)
dsts.map(_.buffer.asInstanceOf[JByteBuffer]).toArray,
offset,
length,
timeout.fold(Long.MaxValue, _.nanos),
timeout.fold(Long.MaxValue, _.toNanos),
TimeUnit.NANOSECONDS,
(),
h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import java.util.concurrent.{ ThreadFactory => JThreadFactory }
import java.util.concurrent.TimeUnit

import zio.{ IO, UIO }
import zio.duration.Duration
import zio.duration._

import scala.concurrent.ExecutionContextExecutorService

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object ScatterGatherChannelSpec extends BaseSpec {
array <- buffer.array
text = array.takeWhile(_ != 10).map(_.toChar).mkString.trim
} yield text
buffs <- IO.collectAll(Seq(Buffer.byte(5), Buffer.byte(5)))
buffs <- IO.collectAll(List(Buffer.byte(5), Buffer.byte(5)))
channel = new FileChannel(fileChannel)
_ <- channel.readBuffer(buffs)
list <- IO.collectAll(buffs.map(readLine))
Expand All @@ -37,7 +37,7 @@ object ScatterGatherChannelSpec extends BaseSpec {
fileChannel = raf.getChannel

buffs <- IO.collectAll(
Seq(
List(
Buffer.byte(Chunk.fromArray("Hello".getBytes)),
Buffer.byte(Chunk.fromArray("World".getBytes))
)
Expand Down
4 changes: 2 additions & 2 deletions nio/src/main/scala/zio/nio/channels/AsynchronousChannel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class AsynchronousSocketChannel(private val channel: JAsynchronousSocketChannel)
effectAsyncWithCompletionHandler[JInteger] { h =>
channel.read(
dst.buffer.asInstanceOf[JByteBuffer],
timeout.fold(Long.MaxValue, _.nanos),
timeout.fold(Long.MaxValue, _.toNanos),
TimeUnit.NANOSECONDS,
(),
h
Expand Down Expand Up @@ -211,7 +211,7 @@ class AsynchronousSocketChannel(private val channel: JAsynchronousSocketChannel)
dsts.map(_.buffer.asInstanceOf[JByteBuffer]).toArray,
offset,
length,
timeout.fold(Long.MaxValue, _.nanos),
timeout.fold(Long.MaxValue, _.toNanos),
TimeUnit.NANOSECONDS,
(),
h
Expand Down
2 changes: 1 addition & 1 deletion nio/src/test/scala/zio/nio/channels/ChannelSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ object ChannelSpec extends BaseSpec {
.catchSomeCause { case Cause.Interrupt(_) => ZIO.unit }
.repeat(Schedule.recurs(20000))
)
assertM(interruptAccept.run)(succeeds(equalTo(20000)))
assertM(interruptAccept.run)(succeeds(equalTo(20000L)))
} @@ ignore
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object ScatterGatherChannelSpec extends BaseSpec {
array <- buffer.array
text = array.takeWhile(_ != 10).map(_.toChar).mkString.trim
} yield text
buffs <- IO.collectAll(Seq(Buffer.byte(5), Buffer.byte(5)))
buffs <- IO.collectAll(List(Buffer.byte(5), Buffer.byte(5)))
list <- FileChannel(fileChannel).use { channel =>
for {
_ <- channel.readBuffer(buffs)
Expand All @@ -40,7 +40,7 @@ object ScatterGatherChannelSpec extends BaseSpec {
fileChannel = raf.getChannel

buffs <- IO.collectAll(
Seq(
List(
Buffer.byte(Chunk.fromArray("Hello".getBytes)),
Buffer.byte(Chunk.fromArray("World".getBytes))
)
Expand Down
2 changes: 1 addition & 1 deletion project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object BuildHelper {
incOptions ~= (_.withLogRecompileOnMacro(false))
)

val ZioCoreVersion = "1.0.0-RC21-2"
val ZioCoreVersion = "1.0.0"

private val Scala211 = "2.11.12"
private val Scala212 = "2.12.11"
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.3")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.13")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.2")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.0")
Expand Down

0 comments on commit d6e06d7

Please sign in to comment.