Skip to content

Commit

Permalink
remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Mar 19, 2017
1 parent 62a31ea commit 11ee56e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Sources/FormData/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public final class Parser {
case .finished(let key, let value):
switch key {
case .name:
name = value.string
name = value.makeString()
case .filename:
filename = value.string
filename = value.makeString()
case .other:
break
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/Multipart/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public final class Parser {

/// Extracts the boundary from a multipart Content-Type header
public static func extractBoundary(contentType: BytesConvertible) throws -> Bytes {
let boundaryPieces = try contentType.makeBytes().string.components(separatedBy: "boundary=")
let boundaryPieces = try contentType.makeBytes().makeString().components(separatedBy: "boundary=")
guard boundaryPieces.count == 2 else {
throw Error.invalidBoundary
}
Expand Down Expand Up @@ -176,8 +176,8 @@ public final class Parser {
case .parsingValue:
break
case .finished(let key, let value):
let headerKey = HeaderKey(key.trimmed([.space]).string)
headers[headerKey] = value.trimmed([.space]).string
let headerKey = HeaderKey(key.trimmed([.space]).makeString())
headers[headerKey] = value.trimmed([.space]).makeString()

// colon newline
let pos = key.count + 1 + value.count + 2
Expand Down
4 changes: 2 additions & 2 deletions Tests/FormDataTests/ParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class ParserTests: XCTestCase {

try parser.multipart.parse(message)

XCTAssertEqual(fields["name"]?.part.body.string, "hi")
XCTAssertEqual(fields["name"]?.part.body.makeString(), "hi")
}

func testFormManyFields() throws {
Expand Down Expand Up @@ -136,7 +136,7 @@ class ParserTests: XCTestCase {
try parser.multipart.parse(message)

for i in 1...5 {
XCTAssertEqual(fields["field\(i)"]?.part.body.string, "The Quick Brown Fox Jumps Over The Lazy Dog", "Field 'field\(i)' was parsed incorrectly!")
XCTAssertEqual(fields["field\(i)"]?.part.body.makeString(), "The Quick Brown Fox Jumps Over The Lazy Dog", "Field 'field\(i)' was parsed incorrectly!")
}
}
}
2 changes: 1 addition & 1 deletion Tests/FormDataTests/SerializerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ class SerializerTests: XCTestCase {
expected += "Test123\r\n"
expected += "--boundary42--\r\n"

XCTAssertEqual(serialized.string, expected)
XCTAssertEqual(serialized.makeString(), expected)
}
}
10 changes: 5 additions & 5 deletions Tests/MultipartTests/ParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ParserTests: XCTestCase {
let preambleExpectation = expectation(description: "preamble was parsed")

parser.onPreamble = { parsedPreamble in
XCTAssertEqual(parsedPreamble.string, preamble)
XCTAssertEqual(parsedPreamble.makeString(), preamble)
preambleExpectation.fulfill()
}

Expand All @@ -59,7 +59,7 @@ class ParserTests: XCTestCase {
let preambleExpectation = expectation(description: "preamble was parsed")

parser.onPreamble = { parsedPreamble in
XCTAssertEqual(parsedPreamble.string, preamble)
XCTAssertEqual(parsedPreamble.makeString(), preamble)
preambleExpectation.fulfill()
}

Expand Down Expand Up @@ -89,7 +89,7 @@ class ParserTests: XCTestCase {
let partExpectation = expectation(description: "part was parsed")

parser.onPart = { part in
XCTAssertEqual(part.body.string, part1)
XCTAssertEqual(part.body.makeString(), part1)
partExpectation.fulfill()
}

Expand All @@ -115,7 +115,7 @@ class ParserTests: XCTestCase {
let partExpectation = expectation(description: "part was parsed")

parser.onPart = { part in
XCTAssertEqual(part.body.string, part1)
XCTAssertEqual(part.body.makeString(), part1)
XCTAssertEqual(part.headers.count, 2)
XCTAssertEqual(part.headers["key"], "value")
XCTAssertEqual(part.headers["foo"], "bar")
Expand Down Expand Up @@ -143,7 +143,7 @@ class ParserTests: XCTestCase {
let epilogueExpectation = expectation(description: "epilogue was parsed")

parser.onEpilogue = { e in
XCTAssertEqual(e.string, epilogue)
XCTAssertEqual(e.makeString(), epilogue)
epilogueExpectation.fulfill()
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/MultipartTests/SerializerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ class SerializerTests: XCTestCase {
expected += "Test123\r\n"
expected += "--boundary42--\r\n"

XCTAssertEqual(serialized.string, expected)
XCTAssertEqual(serialized.makeString(), expected)
}
}

0 comments on commit 11ee56e

Please sign in to comment.