Skip to content

Commit 14fc141

Browse files
MaxDesiatovbnbarham
authored andcommitted
NFC: Fix @Sendable @escaping order, symbol name typo (swiftlang#7446)
Sticking to `@escaping @Sendable` as a preferred order of attributes. Also fixed `dependecies` -> `dependencies` typo. (cherry picked from commit 72b8498)
1 parent 211c28e commit 14fc141

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

Sources/Basics/Concurrency/ConcurrencyHelpers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extension DispatchQueue {
4949

5050
/// Bridges between potentially blocking methods that take a result completion closure and async/await
5151
public func safe_async<T, ErrorType: Error>(
52-
_ body: @Sendable @escaping (@Sendable @escaping (Result<T, ErrorType>) -> Void) -> Void
52+
_ body: @escaping @Sendable (@escaping @Sendable (Result<T, ErrorType>) -> Void) -> Void
5353
) async throws -> T {
5454
try await withCheckedThrowingContinuation { continuation in
5555
// It is possible that body make block indefinitely on a lock, semaphore,

Sources/Basics/FileSystem/TemporaryFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public func withTemporaryDirectory<Result>(
3434
fileSystem: FileSystem = localFileSystem,
3535
dir: AbsolutePath? = nil,
3636
prefix: String = "TemporaryDirectory",
37-
_ body: @Sendable @escaping (AbsolutePath, @escaping (AbsolutePath) -> Void) async throws -> Result
37+
_ body: @escaping @Sendable (AbsolutePath, @escaping (AbsolutePath) -> Void) async throws -> Result
3838
) throws -> Task<Result, Error> {
3939
let temporaryDirectory = try createTemporaryDirectory(fileSystem: fileSystem, dir: dir, prefix: prefix)
4040

Sources/Basics/Observability.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public class ObservabilitySystem {
4646
private struct SingleDiagnosticsHandler: ObservabilityHandlerProvider, DiagnosticsHandler {
4747
var diagnosticsHandler: DiagnosticsHandler { self }
4848

49-
let underlying: @Sendable (ObservabilityScope, Diagnostic)
50-
-> Void
49+
let underlying: @Sendable (ObservabilityScope, Diagnostic) -> Void
5150

5251
init(_ underlying: @escaping @Sendable (ObservabilityScope, Diagnostic) -> Void) {
5352
self.underlying = underlying

Sources/CoreCommands/BuildSystemSupport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private struct NativeBuildSystemFactory: BuildSystemFactory {
5151
),
5252
additionalFileRules: FileRuleDescription.swiftpmFileTypes,
5353
pkgConfigDirectories: self.swiftCommandState.options.locations.pkgConfigDirectories,
54-
dependenciesByRootPackageIdentity: rootPackageInfo.dependecies,
54+
dependenciesByRootPackageIdentity: rootPackageInfo.dependencies,
5555
targetsByRootPackageIdentity: rootPackageInfo.targets,
5656
outputStream: outputStream ?? self.swiftCommandState.outputStream,
5757
logLevel: logLevel ?? self.swiftCommandState.logLevel,

Sources/CoreCommands/SwiftCommandState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ public final class SwiftCommandState {
468468
return workspace
469469
}
470470

471-
public func getRootPackageInformation() throws -> (dependecies: [PackageIdentity: [PackageIdentity]], targets: [PackageIdentity: [String]]) {
471+
public func getRootPackageInformation() throws -> (dependencies: [PackageIdentity: [PackageIdentity]], targets: [PackageIdentity: [String]]) {
472472
let workspace = try self.getActiveWorkspace()
473473
let root = try self.getWorkspaceRoot()
474474
let rootManifests = try temp_await {

Sources/PackageRegistry/SignatureValidation.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct SignatureValidation {
9191
fileSystem: FileSystem,
9292
observabilityScope: ObservabilityScope,
9393
callbackQueue: DispatchQueue,
94-
completion: @Sendable @escaping (Result<SigningEntity?, Error>) -> Void
94+
completion: @escaping @Sendable (Result<SigningEntity?, Error>) -> Void
9595
) {
9696
guard !self.skipSignatureValidation else {
9797
return completion(.success(.none))
@@ -138,7 +138,7 @@ struct SignatureValidation {
138138
fileSystem: FileSystem,
139139
observabilityScope: ObservabilityScope,
140140
callbackQueue: DispatchQueue,
141-
completion: @Sendable @escaping (Result<SigningEntity?, Error>) -> Void
141+
completion: @escaping @Sendable (Result<SigningEntity?, Error>) -> Void
142142
) {
143143
do {
144144
let versionMetadata = try self.versionMetadataProvider(package, version)
@@ -240,7 +240,7 @@ struct SignatureValidation {
240240
configuration: RegistryConfiguration.Security.Signing,
241241
fileSystem: FileSystem,
242242
observabilityScope: ObservabilityScope,
243-
completion: @Sendable @escaping (Result<SigningEntity?, Error>) -> Void
243+
completion: @escaping @Sendable (Result<SigningEntity?, Error>) -> Void
244244
) {
245245
Task {
246246
do {
@@ -353,7 +353,7 @@ struct SignatureValidation {
353353
fileSystem: FileSystem,
354354
observabilityScope: ObservabilityScope,
355355
callbackQueue: DispatchQueue,
356-
completion: @Sendable @escaping (Result<SigningEntity?, Error>) -> Void
356+
completion: @escaping @Sendable (Result<SigningEntity?, Error>) -> Void
357357
) {
358358
guard !self.skipSignatureValidation else {
359359
return completion(.success(.none))
@@ -402,7 +402,7 @@ struct SignatureValidation {
402402
fileSystem: FileSystem,
403403
observabilityScope: ObservabilityScope,
404404
callbackQueue: DispatchQueue,
405-
completion: @Sendable @escaping (Result<SigningEntity?, Error>) -> Void
405+
completion: @escaping @Sendable (Result<SigningEntity?, Error>) -> Void
406406
) {
407407
let manifestName = toolsVersion.map { "Package@swift-\($0).swift" } ?? Manifest.filename
408408

@@ -506,7 +506,7 @@ struct SignatureValidation {
506506
configuration: RegistryConfiguration.Security.Signing,
507507
fileSystem: FileSystem,
508508
observabilityScope: ObservabilityScope,
509-
completion: @Sendable @escaping (Result<SigningEntity?, Error>) -> Void
509+
completion: @escaping @Sendable (Result<SigningEntity?, Error>) -> Void
510510
) {
511511
Task {
512512
do {
@@ -577,7 +577,7 @@ struct SignatureValidation {
577577
signatureFormat: SignatureFormat,
578578
configuration: RegistryConfiguration.Security.Signing,
579579
fileSystem: FileSystem,
580-
completion: @Sendable @escaping (Result<SigningEntity?, Error>) -> Void
580+
completion: @escaping @Sendable (Result<SigningEntity?, Error>) -> Void
581581
) {
582582
Task {
583583
do {

0 commit comments

Comments
 (0)