Skip to content

Commit 62e62b0

Browse files
committed
Wrap initializer in sendable closure
1 parent 36d81b5 commit 62e62b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public final class HeartbeatController: Sendable {
4242
/// Public initializer.
4343
/// - Parameter id: The `id` to associate this controller's heartbeat storage with.
4444
public convenience init(id: String) {
45-
self.init(id: id, dateProvider: Date.init)
45+
self.init(id: id, dateProvider: { Date() })
4646
}
4747

4848
/// Convenience initializer. Mirrors the semantics of the public initializer with the added
@@ -61,7 +61,7 @@ public final class HeartbeatController: Sendable {
6161
/// - storage: A heartbeat storage container.
6262
/// - dateProvider: A date provider. Defaults to providing the current date.
6363
init(storage: HeartbeatStorageProtocol,
64-
dateProvider: @escaping @Sendable () -> Date = Date.init) {
64+
dateProvider: @escaping @Sendable () -> Date = { Date() }) {
6565
self.storage = storage
6666
self.dateProvider = { Self.dateStandardizer.standardize(dateProvider()) }
6767
}

0 commit comments

Comments
 (0)