Replace 'R' with 'ReturnType'
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
One nit. In other places such as the
NIOAsyncChannelor theNonBlockingFileIOwe useResultfor the generic type instead ofReturnType. If we want to be consistent across the project we should useResult.The only public API for
ReturnTypewasAsyncTestingEventLoopfrom what I found.
Not a fan of Result, too similar to Swift.Result. I picked ReturnType as Cory suggested it in the previous PR. I don't mind too much though, can change to Result if you prefer.
I just wanted to point out that Result is the spelling we used most across the project. Personally I am not a fan of seeing Type in generic names. But this is not a hill I want to die on since it is barely user visible.
One more point of reference the Mutex proposal also uses Result
public borrowing func withLock<Result: ~Copyable, E: Error>(
_ body: (transferring inout State) throws(E) -> transferring Result
) throws(E) -> transferring Result
Sounds like you prefer Result. Will change to that.
API breaks are expected