From aa684aa5255e88d0d347afc840dde3c028a6a86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trev=C3=B6r=20Anne=20Denise?= Date: Fri, 13 Sep 2019 15:19:30 +0200 Subject: [PATCH] Remove spaces in range operators --- .swiftformat | 1 + Sources/AsyncHTTPClient/HTTPClientProxyHandler.swift | 2 +- Tests/AsyncHTTPClientTests/HTTPClientTestUtils.swift | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.swiftformat b/.swiftformat index e639ee783..0dcf6d346 100644 --- a/.swiftformat +++ b/.swiftformat @@ -8,5 +8,6 @@ --patternlet inline --stripunusedargs unnamed-only --comments ignore +--ranges nospace # rules diff --git a/Sources/AsyncHTTPClient/HTTPClientProxyHandler.swift b/Sources/AsyncHTTPClient/HTTPClientProxyHandler.swift index 491ca5b88..76b3be0aa 100644 --- a/Sources/AsyncHTTPClient/HTTPClientProxyHandler.swift +++ b/Sources/AsyncHTTPClient/HTTPClientProxyHandler.swift @@ -96,7 +96,7 @@ internal final class HTTPClientProxyHandler: ChannelDuplexHandler, RemovableChan switch res { case .head(let head): switch head.status.code { - case 200 ..< 300: + case 200..<300: // Any 2xx (Successful) response indicates that the sender (and all // inbound proxies) will switch to tunnel mode immediately after the // blank line that concludes the successful response's header section diff --git a/Tests/AsyncHTTPClientTests/HTTPClientTestUtils.swift b/Tests/AsyncHTTPClientTests/HTTPClientTestUtils.swift index 41b22d41b..90f4a72bc 100644 --- a/Tests/AsyncHTTPClientTests/HTTPClientTestUtils.swift +++ b/Tests/AsyncHTTPClientTests/HTTPClientTestUtils.swift @@ -299,7 +299,7 @@ internal final class HttpBinHandler: ChannelInboundHandler { return case "/events/10/1": // TODO: parse path context.write(wrapOutboundOut(.head(HTTPResponseHead(version: HTTPVersion(major: 1, minor: 1), status: .ok))), promise: nil) - for i in 0 ..< 10 { + for i in 0..<10 { let msg = "id: \(i)" var buf = context.channel.allocator.buffer(capacity: msg.count) buf.writeString(msg)