Skip to content

Commit 657602f

Browse files
tomerdcompnerd
andauthored
Apply suggestions from code review
Co-authored-by: Saleem Abdulrasool <[email protected]>
1 parent 4e8c41a commit 657602f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/TSCBasic/Process.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,10 @@ public final class Process: ObjectIdentifierProtocol {
416416
pendingLock.withLock {
417417
if let stderr = pending {
418418
self.stateLock.withLock {
419-
self?.state = .outputReady(stdout: .success(contents), stderr: .success(stderr))
419+
self.state = .outputReady(stdout: .success(contents.withUnsafeBytes { Array<UInt8>($0) }), stderr: .success(stderr))
420420
}
421421
} else {
422-
pending = contents
422+
pending = contents.withUnsafeBytes { Array<UInt8>($0) }
423423
}
424424
}
425425
}
@@ -429,10 +429,10 @@ public final class Process: ObjectIdentifierProtocol {
429429
pendingLock.withLock {
430430
if let stdout = pending {
431431
self.stateLock.withLock {
432-
self?.state = .outputReady(stdout: .success(stdout), stderr: .success(contents))
432+
self.state = .outputReady(stdout: .success(stdout), stderr: .success(contents.withUnsafeBytes { Array<UInt8>($0) }))
433433
}
434434
} else {
435-
pending = contents
435+
pending = contents.withUnsafeBytes { Array<UInt8>($0) }
436436
}
437437
}
438438
}

0 commit comments

Comments
 (0)