From 62e62b0d18897b2c15e8ef8fae48749460866231 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Mon, 28 Oct 2024 13:38:44 -0400 Subject: [PATCH] Wrap initializer in sendable closure --- .../Sources/HeartbeatLogging/HeartbeatController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatController.swift b/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatController.swift index 9259451d248..cbc01844834 100644 --- a/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatController.swift +++ b/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatController.swift @@ -42,7 +42,7 @@ public final class HeartbeatController: Sendable { /// Public initializer. /// - Parameter id: The `id` to associate this controller's heartbeat storage with. public convenience init(id: String) { - self.init(id: id, dateProvider: Date.init) + self.init(id: id, dateProvider: { Date() }) } /// Convenience initializer. Mirrors the semantics of the public initializer with the added @@ -61,7 +61,7 @@ public final class HeartbeatController: Sendable { /// - storage: A heartbeat storage container. /// - dateProvider: A date provider. Defaults to providing the current date. init(storage: HeartbeatStorageProtocol, - dateProvider: @escaping @Sendable () -> Date = Date.init) { + dateProvider: @escaping @Sendable () -> Date = { Date() }) { self.storage = storage self.dateProvider = { Self.dateStandardizer.standardize(dateProvider()) } }