@@ -274,11 +274,11 @@ extension FileSystemProtocol {
274
274
/// automatically after the closure exits.
275
275
/// - Important: The handle passed to `execute` must not escape the closure.
276
276
/// - Returns: The result of the `execute` closure.
277
- public func withFileHandle< R > (
277
+ public func withFileHandle< Result > (
278
278
forReadingAt path: FilePath ,
279
279
options: OpenOptions . Read = OpenOptions . Read ( ) ,
280
- execute: ( _ read: ReadFileHandle ) async throws -> R
281
- ) async throws -> R {
280
+ execute: ( _ read: ReadFileHandle ) async throws -> Result
281
+ ) async throws -> Result {
282
282
let handle = try await self . openFile ( forReadingAt: path, options: options)
283
283
return try await withUncancellableTearDown {
284
284
return try await execute ( handle)
@@ -301,11 +301,11 @@ extension FileSystemProtocol {
301
301
/// automatically after the closure exits.
302
302
/// - Important: The handle passed to `execute` must not escape the closure.
303
303
/// - Returns: The result of the `execute` closure.
304
- public func withFileHandle< R > (
304
+ public func withFileHandle< Result > (
305
305
forWritingAt path: FilePath ,
306
306
options: OpenOptions . Write = . newFile( replaceExisting: false ) ,
307
- execute: ( _ write: WriteFileHandle ) async throws -> R
308
- ) async throws -> R {
307
+ execute: ( _ write: WriteFileHandle ) async throws -> Result
308
+ ) async throws -> Result {
309
309
let handle = try await self . openFile ( forWritingAt: path, options: options)
310
310
return try await withUncancellableTearDown {
311
311
return try await execute ( handle)
@@ -333,11 +333,11 @@ extension FileSystemProtocol {
333
333
/// automatically after the closure exits.
334
334
/// - Important: The handle passed to `execute` must not escape the closure.
335
335
/// - Returns: The result of the `execute` closure.
336
- public func withFileHandle< R > (
336
+ public func withFileHandle< Result > (
337
337
forReadingAndWritingAt path: FilePath ,
338
338
options: OpenOptions . Write = . newFile( replaceExisting: false ) ,
339
- execute: ( _ readWrite: ReadWriteFileHandle ) async throws -> R
340
- ) async throws -> R {
339
+ execute: ( _ readWrite: ReadWriteFileHandle ) async throws -> Result
340
+ ) async throws -> Result {
341
341
let handle = try await self . openFile ( forReadingAndWritingAt: path, options: options)
342
342
return try await withUncancellableTearDown {
343
343
return try await execute ( handle)
@@ -354,11 +354,11 @@ extension FileSystemProtocol {
354
354
/// - execute: A closure which provides access to the directory.
355
355
/// - Important: The handle passed to `execute` must not escape the closure.
356
356
/// - Returns: The result of the `execute` closure.
357
- public func withDirectoryHandle< R > (
357
+ public func withDirectoryHandle< Result > (
358
358
atPath path: FilePath ,
359
359
options: OpenOptions . Directory = OpenOptions . Directory ( ) ,
360
- execute: ( _ directory: DirectoryFileHandle ) async throws -> R
361
- ) async throws -> R {
360
+ execute: ( _ directory: DirectoryFileHandle ) async throws -> Result
361
+ ) async throws -> Result {
362
362
let handle = try await self . openDirectory ( atPath: path, options: options)
363
363
return try await withUncancellableTearDown {
364
364
return try await execute ( handle)
@@ -490,11 +490,11 @@ extension FileSystemProtocol {
490
490
/// - options: Options used to create the directory.
491
491
/// - execute: A closure which provides access to the directory and its path.
492
492
/// - Returns: The result of `execute`.
493
- public func withTemporaryDirectory< ReturnType > (
493
+ public func withTemporaryDirectory< Result > (
494
494
prefix: FilePath ? = nil ,
495
495
options: OpenOptions . Directory = OpenOptions . Directory ( ) ,
496
- execute: ( _ directory: DirectoryFileHandle , _ path: FilePath ) async throws -> ReturnType
497
- ) async throws -> ReturnType {
496
+ execute: ( _ directory: DirectoryFileHandle , _ path: FilePath ) async throws -> Result
497
+ ) async throws -> Result {
498
498
let template : FilePath
499
499
500
500
if let prefix = prefix {
0 commit comments