From e85b508ac6e1d5d88acc2dccaec39b562284db44 Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Fri, 25 Aug 2023 01:42:16 +0900 Subject: [PATCH] use ownership modifier (#411) --- Sources/Verge/Library/EventEmitter.swift | 6 +++--- Sources/Verge/Library/VergeConcurrency.swift | 4 ++-- Sources/Verge/Store/Store.swift | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/Verge/Library/EventEmitter.swift b/Sources/Verge/Library/EventEmitter.swift index 504bd7d244..7ed9ed8231 100644 --- a/Sources/Verge/Library/EventEmitter.swift +++ b/Sources/Verge/Library/EventEmitter.swift @@ -79,7 +79,7 @@ open class EventEmitter: EventEmitterType, @unchecked Sendable { } @_spi(EventEmitter) - public func accept(_ event: Event) { + public func accept(_ event: consuming Event) { /** https://github.com/VergeGroup/Verge/pull/220 @@ -126,8 +126,8 @@ open class EventEmitter: EventEmitterType, @unchecked Sendable { } - open func receiveEvent(_ event: Event) { - + open func receiveEvent(_ event: consuming Event) { + } @_spi(EventEmitter) diff --git a/Sources/Verge/Library/VergeConcurrency.swift b/Sources/Verge/Library/VergeConcurrency.swift index 0259f6c8c5..972fd1f2ef 100644 --- a/Sources/Verge/Library/VergeConcurrency.swift +++ b/Sources/Verge/Library/VergeConcurrency.swift @@ -27,7 +27,7 @@ public enum VergeConcurrency { } - public final class UnfairLock: Sendable { + public struct UnfairLock: ~Copyable { private let _lock: os_unfair_lock_t public init() { @@ -202,5 +202,5 @@ public enum VergeConcurrency { } } } - + } diff --git a/Sources/Verge/Store/Store.swift b/Sources/Verge/Store/Store.swift index fdb47f95c7..b858abff45 100644 --- a/Sources/Verge/Store/Store.swift +++ b/Sources/Verge/Store/Store.swift @@ -185,8 +185,8 @@ open class Store: EventEmitter<_StoreEvent) { - + public final override func receiveEvent(_ event: consuming _StoreEvent) { + switch event { case .state(let stateEvent): switch stateEvent {