From ccbdfa895da761370e308cfaf401faa15e66f280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Wed, 13 Jan 2021 18:19:24 +0100 Subject: [PATCH] Avoid some new compile warnings 5.3 it is. --- Sources/IRC/IRCClient.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/IRC/IRCClient.swift b/Sources/IRC/IRCClient.swift index 0147c25..9c71b3d 100644 --- a/Sources/IRC/IRCClient.swift +++ b/Sources/IRC/IRCClient.swift @@ -2,7 +2,7 @@ // // This source file is part of the swift-nio-irc open source project // -// Copyright (c) 2018 ZeeZide GmbH. and the swift-nio-irc project authors +// Copyright (c) 2018-2020 ZeeZide GmbH. and the swift-nio-irc project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -132,15 +132,19 @@ open class IRCClient : IRCClientMessageTarget { self.eventLoop = eventLoop // what a mess :-) - var overrideBootstrap : NIOClientTCPBootstrapProtocol? #if canImport(NIOTransportServices) #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) + var overrideBootstrap : NIOClientTCPBootstrapProtocol? if #available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) { if options.eventLoopGroup is NIOTSEventLoopGroup { overrideBootstrap = NIOTSConnectionBootstrap(group: eventLoop) } } + #else + let overrideBootstrap : NIOClientTCPBootstrapProtocol? = nil #endif + #else + let overrideBootstrap : NIOClientTCPBootstrapProtocol? = nil #endif self.bootstrap = overrideBootstrap ?? ClientBootstrap(group: eventLoop) @@ -408,7 +412,7 @@ open class IRCClient : IRCClientMessageTarget { func errorCaught(context: ChannelHandlerContext, error: Error) { self.client.handlerCaughtError(error, in: context) - _ = context.close(promise: nil) + context.close(promise: nil) } }