Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AnyClock a class. #41

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/Clocks/AnyClock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/// }
/// ```
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
public struct AnyClock<Duration: DurationProtocol & Hashable>: Clock {
public final class AnyClock<Duration: DurationProtocol & Hashable>: Clock {
public struct Instant: InstantProtocol {
fileprivate let offset: Duration

Expand All @@ -50,9 +50,9 @@
}
}

private var _minimumResolution: @Sendable () -> Duration
private var _now: @Sendable () -> Instant
private var _sleep: @Sendable (Instant, Duration?) async throws -> Void
private let _minimumResolution: @Sendable () -> Duration
private let _now: @Sendable () -> Instant
private let _sleep: @Sendable (Instant, Duration?) async throws -> Void

public init<C: Clock>(_ clock: C) where C.Instant.Duration == Duration {
let start = clock.now
Expand Down