Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace 'R' with 'ReturnType' #2709

Merged
merged 1 commit into from Apr 29, 2024
Merged

Conversation

glbrntt
Copy link
Contributor

@glbrntt glbrntt commented Apr 26, 2024

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

@glbrntt glbrntt added the 🔼 needs-minor-version-bump For PRs that when merged cause a bump of the minor version, ie. 1.x.0 -> 1.(x+1).0 label Apr 26, 2024
Copy link
Contributor

@FranzBusch FranzBusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit. In other places such as the NIOAsyncChannel or the NonBlockingFileIO we use Result for the generic type instead of ReturnType. If we want to be consistent across the project we should use Result.

The only public API for ReturnType was AsyncTestingEventLoop from what I found.

@glbrntt
Copy link
Contributor Author

glbrntt commented Apr 26, 2024

One nit. In other places such as the NIOAsyncChannel or the NonBlockingFileIO we use Result for the generic type instead of ReturnType. If we want to be consistent across the project we should use Result.

The only public API for ReturnType was AsyncTestingEventLoop from 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.

@FranzBusch
Copy link
Contributor

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.

@FranzBusch
Copy link
Contributor

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

@glbrntt
Copy link
Contributor Author

glbrntt commented Apr 26, 2024

Sounds like you prefer Result. Will change to that.

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
@glbrntt
Copy link
Contributor Author

glbrntt commented Apr 29, 2024

API breaks are expected

@glbrntt glbrntt disabled auto-merge April 29, 2024 10:01
@glbrntt glbrntt merged commit 29e832a into apple:main Apr 29, 2024
7 of 9 checks passed
@glbrntt glbrntt deleted the rename-return-type branch April 29, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔼 needs-minor-version-bump For PRs that when merged cause a bump of the minor version, ie. 1.x.0 -> 1.(x+1).0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants