Replace 'R' with 'Result' (#2709)

Motivation:

Single letter names are discouraged but are used in a handful of places
in NIOFileSystem.

Modifications:

- Replace 'R' with 'ReturnType' where appropriate

Result:

Clearer APIs
This commit is contained in:
George Barnett authored and GitHub committed 2024-04-29 11:01:17 +01:00
1 parent 8c3135b7d4
commit 29e832adda
4 files changed
+33 -33

No files matched your search

+3 -3
View File
@@ -700,10 +700,10 @@ extension FileSystemProtocol where Self == FileSystem {
/// Provides temporary scoped access to a ``FileSystem`` with the given number of threads.
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
public func withFileSystem<R>(
public func withFileSystem<Result>(
numberOfThreads: Int,
_ body: (FileSystem) async throws -> R
) async throws -> R {
_ body: (FileSystem) async throws -> Result
) async throws -> Result {
let fileSystem = await FileSystem(numberOfThreads: numberOfThreads)
return try await withUncancellableTearDown {
try await body(fileSystem)