Skip to content

Commit

Permalink
Avoid some new compile warnings
Browse files Browse the repository at this point in the history
5.3 it is.
  • Loading branch information
helje5 committed Jan 13, 2021
1 parent b3612d6 commit ccbdfa8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Sources/IRC/IRCClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit ccbdfa8

Please sign in to comment.