From 8b0adf4e3e31ddc339964df4fa6782f6987479af Mon Sep 17 00:00:00 2001 From: Francesco Paolo Severino Date: Sat, 14 Dec 2024 17:11:51 +0100 Subject: [PATCH] Make the linter happy --- Sources/Orders/OrdersService.swift | 2 +- Sources/Orders/OrdersServiceCustom.swift | 7 ++++--- Sources/Passes/PassesServiceCustom.swift | 7 ++++--- Tests/PassesTests/PassesTests.swift | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Sources/Orders/OrdersService.swift b/Sources/Orders/OrdersService.swift index df3cce4..4224ad7 100644 --- a/Sources/Orders/OrdersService.swift +++ b/Sources/Orders/OrdersService.swift @@ -9,7 +9,7 @@ import FluentKit import Vapor /// The main class that handles Wallet orders. -public final class OrdersService: Sendable where Order == OD.OrderType{ +public final class OrdersService: Sendable where Order == OD.OrderType { private let service: OrdersServiceCustom /// Initializes the service and registers all the routes required for Apple Wallet to work. diff --git a/Sources/Orders/OrdersServiceCustom.swift b/Sources/Orders/OrdersServiceCustom.swift index 81ee591..84c8208 100644 --- a/Sources/Orders/OrdersServiceCustom.swift +++ b/Sources/Orders/OrdersServiceCustom.swift @@ -149,9 +149,10 @@ extension OrdersServiceCustom { throw Abort(.notModified) } - guard let orderData = try await OD.query(on: req.db) - .filter(\._$order.$id == id) - .first() + guard + let orderData = try await OD.query(on: req.db) + .filter(\._$order.$id == id) + .first() else { throw Abort(.notFound) } diff --git a/Sources/Passes/PassesServiceCustom.swift b/Sources/Passes/PassesServiceCustom.swift index 1bc65d1..20cd6cc 100644 --- a/Sources/Passes/PassesServiceCustom.swift +++ b/Sources/Passes/PassesServiceCustom.swift @@ -241,9 +241,10 @@ extension PassesServiceCustom { throw Abort(.notModified) } - guard let passData = try await PD.query(on: req.db) - .filter(\._$pass.$id == id) - .first() + guard + let passData = try await PD.query(on: req.db) + .filter(\._$pass.$id == id) + .first() else { throw Abort(.notFound) } diff --git a/Tests/PassesTests/PassesTests.swift b/Tests/PassesTests/PassesTests.swift index a1c1f1f..28ecd02 100644 --- a/Tests/PassesTests/PassesTests.swift +++ b/Tests/PassesTests/PassesTests.swift @@ -80,7 +80,7 @@ struct PassesTests { let pass = try await passData.$pass.get(on: app.db) let data = try await passesService.build(pass: passData, on: app.db) - + let passURL = FileManager.default.temporaryDirectory.appendingPathComponent("\(UUID().uuidString).pkpass") try data.write(to: passURL) let passFolder = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString, isDirectory: true)