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

Improving lowering error types #431

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

robertbastian
Copy link
Collaborator

Lowering currently uses Options for three different purposes, which is confusing:

  • signaling failure
  • unit return type
  • absent lifetime env

I changed the first case to Result<T, ()>, and the last case to non-optional.

@robertbastian
Copy link
Collaborator Author

The second commit replaces Option<SuccessType> by a new SuccessType::Unit variant, which simplifies logic and is less error prone.

Copy link
Contributor

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Splitting None and Err seems good

@robertbastian robertbastian merged commit c79ab6d into rust-diplomat:main Feb 21, 2024
6 checks passed
Copy link
Contributor

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

r+

@robertbastian robertbastian deleted the lowering branch February 22, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants