Skip to content

Commit

Permalink
Fix Sendable warning in RFC1123
Browse files Browse the repository at this point in the history
  • Loading branch information
0xTim committed Apr 30, 2024
1 parent e87730e commit a85e5cb
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions Sources/Vapor/Utilities/RFC1123.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,9 @@ import NIOCore
import NIOConcurrencyHelpers

/// An internal helper that formats cookie dates as RFC1123
private final class RFC1123 {
/// Thread-specific RFC1123
private static let thread: ThreadSpecificVariable<RFC1123> = .init()

private struct RFC1123: Sendable {
/// A static RFC1123 helper instance
static var shared: RFC1123 {
if let existing = thread.currentValue {
return existing
} else {
let new = RFC1123()
thread.currentValue = new
return new
}
}
static let shared: RFC1123 = .init()

/// The RFC1123 formatter
private let formatter: DateFormatter
Expand Down

0 comments on commit a85e5cb

Please sign in to comment.