From 13baaa80a5d36602cd8065ab07053d06338c6f70 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Sun, 16 Jun 2024 10:35:12 -0700 Subject: [PATCH] Drop inner `@MainActor` from `withMainSerialExecutor` (#28) The inner operation is implicitly main actor, so no need to be explicit about it. Fixes #27. --- Sources/ConcurrencyExtras/MainSerialExecutor.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ConcurrencyExtras/MainSerialExecutor.swift b/Sources/ConcurrencyExtras/MainSerialExecutor.swift index 006e025..d448532 100644 --- a/Sources/ConcurrencyExtras/MainSerialExecutor.swift +++ b/Sources/ConcurrencyExtras/MainSerialExecutor.swift @@ -29,7 +29,7 @@ /// - Parameter operation: An operation to be performed on the main serial executor. @MainActor public func withMainSerialExecutor( - @_implicitSelfCapture operation: @MainActor @Sendable () async throws -> Void + @_implicitSelfCapture operation: @Sendable () async throws -> Void ) async rethrows { let didUseMainSerialExecutor = uncheckedUseMainSerialExecutor defer { uncheckedUseMainSerialExecutor = didUseMainSerialExecutor }