From 8b7348bfa84a7343338866fb158077a0dc6e0dc5 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Sat, 22 Jul 2023 07:04:56 -0300 Subject: [PATCH] Run `swift format` --- .../PostgRESTTests/BuildURLRequestTests.swift | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Tests/PostgRESTTests/BuildURLRequestTests.swift b/Tests/PostgRESTTests/BuildURLRequestTests.swift index ad8ed18..3d41666 100644 --- a/Tests/PostgRESTTests/BuildURLRequestTests.swift +++ b/Tests/PostgRESTTests/BuildURLRequestTests.swift @@ -115,35 +115,35 @@ } } -final class LockIsolated: @unchecked Sendable { - private let lock = NSRecursiveLock() - private var _value: Value + final class LockIsolated: @unchecked Sendable { + private let lock = NSRecursiveLock() + private var _value: Value - init(_ value: Value) { - self._value = value - } + init(_ value: Value) { + self._value = value + } - @discardableResult - func withValue(_ block: (inout Value) throws -> T) rethrows -> T { - try lock.sync { - var value = self._value - defer { self._value = value } - return try block(&value) + @discardableResult + func withValue(_ block: (inout Value) throws -> T) rethrows -> T { + try lock.sync { + var value = self._value + defer { self._value = value } + return try block(&value) + } } - } - var value: Value { - lock.sync { self._value } + var value: Value { + lock.sync { self._value } + } } -} - -extension NSRecursiveLock { - @discardableResult - func sync(work: () throws -> R) rethrows -> R { - lock() - defer { unlock() } - return try work() + + extension NSRecursiveLock { + @discardableResult + func sync(work: () throws -> R) rethrows -> R { + lock() + defer { unlock() } + return try work() + } } -} #endif