mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
remove redundant labels
Motivation:
Lots of our most important operations had redundant labels like
func write(data: NIOAny)
the `data: ` label doesn't add anything meaningful and therefore it
should be removed.
Modifications:
removed lots of redundant labels
Result:
less redundant labels
This commit is contained in:
1 parent
dba0a5379c
commit
eaa8ffaee4
35 files changed
+335
-335
No files matched your search
@@ -32,7 +32,7 @@ class HTTPRequestEncoderTests: XCTestCase {
|
||||
try channel.pipeline.add(handler: HTTPRequestEncoder()).wait()
|
||||
var request = HTTPRequestHead(version: HTTPVersion(major: 1, minor:1), method: method, uri: "/uri")
|
||||
request.headers = headers
|
||||
try channel.writeOutbound(data: HTTPClientRequestPart.head(request))
|
||||
try channel.writeOutbound(HTTPClientRequestPart.head(request))
|
||||
if case .some(.byteBuffer(let buffer)) = channel.readOutbound() {
|
||||
return buffer
|
||||
} else {
|
||||
@@ -82,7 +82,7 @@ class HTTPRequestEncoderTests: XCTestCase {
|
||||
|
||||
// This request contains neither Transfer-Encoding: chunked or Content-Length.
|
||||
let request = HTTPRequestHead(version: HTTPVersion(major: 1, minor:0), method: .GET, uri: "/uri")
|
||||
XCTAssertNoThrow(try channel.writeOutbound(data: HTTPClientRequestPart.head(request)))
|
||||
XCTAssertNoThrow(try channel.writeOutbound(HTTPClientRequestPart.head(request)))
|
||||
let writtenData: IOData = channel.readOutbound()!
|
||||
|
||||
switch writtenData {
|
||||
@@ -107,9 +107,9 @@ class HTTPRequestEncoderTests: XCTestCase {
|
||||
var buf = channel.allocator.buffer(capacity: 4)
|
||||
buf.write(staticString: "test")
|
||||
|
||||
XCTAssertNoThrow(try channel.writeOutbound(data: HTTPClientRequestPart.head(request)))
|
||||
XCTAssertNoThrow(try channel.writeOutbound(data: HTTPClientRequestPart.body(.byteBuffer(buf))))
|
||||
XCTAssertNoThrow(try channel.writeOutbound(data: HTTPClientRequestPart.end(nil)))
|
||||
XCTAssertNoThrow(try channel.writeOutbound(HTTPClientRequestPart.head(request)))
|
||||
XCTAssertNoThrow(try channel.writeOutbound(HTTPClientRequestPart.body(.byteBuffer(buf))))
|
||||
XCTAssertNoThrow(try channel.writeOutbound(HTTPClientRequestPart.end(nil)))
|
||||
|
||||
assertOutboundContainsOnly(channel, "POST /uri HTTP/1.1\r\ncontent-length: 4\r\n\r\n")
|
||||
assertOutboundContainsOnly(channel, "test")
|
||||
|
||||
Reference in new issue
Block a user