Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings in Xcode 12 [DOES NOT WORK] #2405

Merged
merged 2 commits into from Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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