Skip to content

Commit

Permalink
Fix warnings in Xcode 12 (#2405)
Browse files Browse the repository at this point in the history
* update for xcode 12

* use (#file) instead
  • Loading branch information
tanner0101 committed Jun 23, 2020
1 parent 2bfe714 commit 6146347
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Sources/Development/routes.swift
Expand Up @@ -89,7 +89,7 @@ public func routes(_ app: Application) throws {
guard let running = req.application.running else {
throw Abort(.internalServerError)
}
_ = running.stop()
running.stop()
return .ok
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/Vapor/Utilities/Base32.swift
Expand Up @@ -14,7 +14,7 @@ extension Data {
/// Decodes base32 encoded `Data`.
public init?(base32Encoded: Data) {
let maxSize = (base32Encoded.count * 5 + 4) / 8
var result = UnsafeMutablePointer<UInt8>.allocate(capacity: maxSize)
let result = UnsafeMutablePointer<UInt8>.allocate(capacity: maxSize)
defer {
result.deinitialize(count: maxSize)
result.deallocate()
Expand All @@ -37,7 +37,7 @@ extension Data {
/// - returns: The base32 encoded data.
public func base32EncodedData() -> Data {
let maxSize = (count * 8 + 4) / 5
var result = UnsafeMutablePointer<UInt8>.allocate(capacity: maxSize)
let result = UnsafeMutablePointer<UInt8>.allocate(capacity: maxSize)
defer {
result.deinitialize(count: maxSize)
result.deallocate()
Expand Down
2 changes: 1 addition & 1 deletion Sources/XCTVapor/XCTApplication.swift
Expand Up @@ -104,7 +104,7 @@ extension XCTApplicationTester {
_ path: String,
headers: HTTPHeaders = [:],
body: ByteBuffer? = nil,
file: StaticString = #file,
file: StaticString = (#file),
line: UInt = #line,
beforeRequest: (inout XCTHTTPRequest) throws -> () = { _ in },
afterResponse: (XCTHTTPResponse) throws -> () = { _ in }
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTVapor/XCTHTTPResponse.swift
Expand Up @@ -42,7 +42,7 @@ extension Response.Body {
public func XCTAssertContent<D>(
_ type: D.Type,
_ res: XCTHTTPResponse,
file: StaticString = #file,
file: StaticString = (#file),
line: UInt = #line,
_ closure: (D) -> ()
)
Expand All @@ -61,7 +61,7 @@ public func XCTAssertContent<D>(
}
}

public func XCTAssertContains(_ haystack: String?, _ needle: String?, file: StaticString = #file, line: UInt = #line) {
public func XCTAssertContains(_ haystack: String?, _ needle: String?, file: StaticString = (#file), line: UInt = #line) {
switch (haystack, needle) {
case (.some(let haystack), .some(let needle)):
XCTAssert(haystack.contains(needle), "\(haystack) does not contain \(needle)", file: file, line: line)
Expand All @@ -74,7 +74,7 @@ public func XCTAssertContains(_ haystack: String?, _ needle: String?, file: Stat
}
}

public func XCTAssertEqualJSON<T>(_ data: String?, _ test: T, file: StaticString = #file, line: UInt = #line)
public func XCTAssertEqualJSON<T>(_ data: String?, _ test: T, file: StaticString = (#file), line: UInt = #line)
where T: Codable & Equatable
{
guard let data = data else {
Expand Down
2 changes: 1 addition & 1 deletion Tests/VaporTests/ErrorTests.swift
Expand Up @@ -154,7 +154,7 @@ final class ErrorTests: XCTestCase {
func XCTAssertContains(
_ haystack: String?,
_ needle: String,
file: StaticString = #file,
file: StaticString = (#file),
line: UInt = #line
) {
guard let haystack = haystack else {
Expand Down
4 changes: 2 additions & 2 deletions Tests/VaporTests/PasswordTests.swift
Expand Up @@ -82,7 +82,7 @@ final class PasswordTests: XCTestCase {
private func assertAsyncApplicationPasswordVerifies(
_ provider: Application.Passwords.Provider,
on app: Application,
file: StaticString = #file,
file: StaticString = (#file),
line: UInt = #line
) throws {
app.passwords.use(provider)
Expand All @@ -103,7 +103,7 @@ final class PasswordTests: XCTestCase {
private func assertAsyncRequestPasswordVerifies(
_ provider: Application.Passwords.Provider,
on app: Application,
file: StaticString = #file,
file: StaticString = (#file),
line: UInt = #line
) throws {
app.passwords.use(provider)
Expand Down
4 changes: 2 additions & 2 deletions Tests/VaporTests/ValidationTests.swift
Expand Up @@ -281,7 +281,7 @@ private func assert<T>(
_ data: T,
fails validator: Validator<T>,
_ description: String,
file: StaticString = #file,
file: StaticString = (#file),
line: UInt = #line
) {
let result = validator.validate(data)
Expand All @@ -292,7 +292,7 @@ private func assert<T>(
private func assert<T>(
_ data: T,
passes validator: Validator<T>,
file: StaticString = #file,
file: StaticString = (#file),
line: UInt = #line
) {
let result = validator.validate(data)
Expand Down

0 comments on commit 6146347

Please sign in to comment.