From 101d841074d918469e4759f62a770da5aa863ac5 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Mon, 22 Dec 2025 16:33:22 +0400 Subject: [PATCH] refactoring: remove `nonisolated(unsafe)` --- Sources/Log/Classes/Models/LogLevel.swift | 42 ++++++++--------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/Sources/Log/Classes/Models/LogLevel.swift b/Sources/Log/Classes/Models/LogLevel.swift index 6cda93e..519e5e8 100644 --- a/Sources/Log/Classes/Models/LogLevel.swift +++ b/Sources/Log/Classes/Models/LogLevel.swift @@ -8,7 +8,7 @@ import Foundation // MARK: - LogLevel /// A set that includes all log levels. -public struct LogLevel: OptionSet { +public struct LogLevel: OptionSet, Sendable { // MARK: Initialization /// Creates a new log level. @@ -22,33 +22,19 @@ public struct LogLevel: OptionSet { public typealias RawValue = UInt - #if swift(>=6.0) - /// Creates a new default `.off` instance with a bitmask of `1 << 0`. - public nonisolated(unsafe) static let off = LogLevel(rawValue: offBitmask) - /// Creates a new default `.debug` instance with a bitmask of `1 << 1`. - public nonisolated(unsafe) static let debug = LogLevel(rawValue: debugBitmask) - /// Creates a new default `.info` instance with a bitmask of `1 << 2`. - public nonisolated(unsafe) static let info = LogLevel(rawValue: infoBitmask) - /// Creates a new default `.error` instance with a bitmask of `1 << 3`. - public nonisolated(unsafe) static let error = LogLevel(rawValue: errorBitmask) - /// Creates a new default `.fault` instance with a bitmask of `1 << 4`. - public nonisolated(unsafe) static let fault = LogLevel(rawValue: faultBitmask) - /// Creates a new default `.error` instance. - public nonisolated(unsafe) static let all = LogLevel(rawValue: allBitmask) - #else - /// Creates a new default `.off` instance with a bitmask of `1 << 0`. - public static let off = LogLevel(rawValue: offBitmask) - /// Creates a new default `.debug` instance with a bitmask of `1 << 1`. - public static let debug = LogLevel(rawValue: debugBitmask) - /// Creates a new default `.info` instance with a bitmask of `1 << 2`. - public static let info = LogLevel(rawValue: infoBitmask) - /// Creates a new default `.error` instance with a bitmask of `1 << 3`. - public static let error = LogLevel(rawValue: errorBitmask) - /// Creates a new default `.fault` instance with a bitmask of `1 << 4`. - public static let fault = LogLevel(rawValue: faultBitmask) - /// Creates a new default `.error` instance. - public static let all = LogLevel(rawValue: allBitmask) - #endif + /// Creates a new default `.off` instance with a bitmask of `1 << 0`. + public static let off = LogLevel(rawValue: offBitmask) + /// Creates a new default `.debug` instance with a bitmask of `1 << 1`. + public static let debug = LogLevel(rawValue: debugBitmask) + /// Creates a new default `.info` instance with a bitmask of `1 << 2`. + public static let info = LogLevel(rawValue: infoBitmask) + /// Creates a new default `.error` instance with a bitmask of `1 << 3`. + public static let error = LogLevel(rawValue: errorBitmask) + /// Creates a new default `.fault` instance with a bitmask of `1 << 4`. + public static let fault = LogLevel(rawValue: faultBitmask) + /// Creates a new default `.error` instance. + public static let all = LogLevel(rawValue: allBitmask) + /// Returns the raw bitmask value of the LogLevel and satisfies the `RawRepresentable` protocol. public let rawValue: RawValue