Skip to content

Commit

Permalink
fmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
quelgar committed Oct 21, 2020
1 parent 9945c12 commit 7c9865e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ final class ServerSocketChannel(override protected val channel: JServerSocketCha
def accept: Managed[IOException, Option[SocketChannel]] =
IO.effect(Option(channel.accept()).map(new SocketChannel(_)))
.refineToOrDie[IOException]
.toManaged(IO.whenCase(_) {
case Some(channel) => channel.close.ignore
.toManaged(IO.whenCase(_) { case Some(channel) =>
channel.close.ignore
})

val localAddress: IO[IOException, SocketAddress] =
Expand Down
3 changes: 1 addition & 2 deletions nio-core/src/main/scala/zio/nio/core/file/WatchService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ final class WatchService private (private[file] val javaWatchService: JWatchServ

object WatchService {

def forDefaultFileSystem: ZManaged[Blocking, IOException, WatchService] =
FileSystem.default.newWatchService
def forDefaultFileSystem: ZManaged[Blocking, IOException, WatchService] = FileSystem.default.newWatchService

def fromJava(javaWatchService: JWatchService): WatchService = new WatchService(javaWatchService)
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ object DatagramChannelSpec extends BaseSpec {
} yield assert(same)(isTrue)
},
testM("close channel unbind port") {
def client(address: SocketAddress): IO[IOException, Unit] =
DatagramChannel.open.use(_.connect(address).unit)
def client(address: SocketAddress): IO[IOException, Unit] = DatagramChannel.open.use(_.connect(address).unit)

def server(
address: SocketAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ object SelectorSpec extends BaseSpec {
for {
scopeResult <- scope(channel.accept)
(_, maybeClient) = scopeResult
_ <- IO.whenCase(maybeClient) {
case Some(client) =>
client.configureBlocking(false) *> client.register(selector, Operation.Read)
_ <- IO.whenCase(maybeClient) { case Some(client) =>
client.configureBlocking(false) *> client.register(selector, Operation.Read)
}
} yield ()
case client: SocketChannel if readyOps(Operation.Read) =>
Expand Down

0 comments on commit 7c9865e

Please sign in to comment.