From a0b7f646fba61402da384b3202f54c27debb5e13 Mon Sep 17 00:00:00 2001 From: Tim <0xTim@users.noreply.github.com> Date: Fri, 23 Mar 2018 16:28:43 +0000 Subject: [PATCH] Fixes build issue on 4.1 (#229) Motivation: Resolves #228 Modifications: Remove type information in empty closure fixed build warning with compiler suggestion Result: No API changes, no issues building on 4.1! --- Sources/NIO/System.swift | 2 +- Sources/NIOWebSocketServer/main.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/NIO/System.swift b/Sources/NIO/System.swift index 187c2b31cf..ad2a280ae9 100644 --- a/Sources/NIO/System.swift +++ b/Sources/NIO/System.swift @@ -57,7 +57,7 @@ private let sysFreeifaddrs: @convention(c) (UnsafeMutablePointer?) -> V private let sysAF_INET = AF_INET private let sysAF_INET6 = AF_INET6 private let sysAF_UNIX = AF_UNIX -private let sysInet_ntop: @convention(c) (CInt, UnsafeRawPointer?, UnsafeMutablePointer?, socklen_t) -> UnsafePointer! = inet_ntop +private let sysInet_ntop: @convention(c) (CInt, UnsafeRawPointer?, UnsafeMutablePointer?, socklen_t) -> UnsafePointer? = inet_ntop #if os(Linux) private let sysSendMmsg: @convention(c) (CInt, UnsafeMutablePointer?, CUnsignedInt, CInt) -> CInt = CNIOLinux_sendmmsg diff --git a/Sources/NIOWebSocketServer/main.swift b/Sources/NIOWebSocketServer/main.swift index 3361357e71..93ec87f56b 100644 --- a/Sources/NIOWebSocketServer/main.swift +++ b/Sources/NIOWebSocketServer/main.swift @@ -145,7 +145,7 @@ private final class WebSocketTimeHandler: ChannelInboundHandler { buffer.write(string: "\(theTime)") let frame = WebSocketFrame(fin: true, opcode: .text, data: buffer) - ctx.writeAndFlush(self.wrapOutboundOut(frame)).map { (_: Void) in + ctx.writeAndFlush(self.wrapOutboundOut(frame)).map { _ = ctx.eventLoop.scheduleTask(in: .seconds(1), { self.sendTime(ctx: ctx) }) }.whenFailure { (_: Error) in ctx.close(promise: nil)