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

Remove Option return from Context::object_type #117

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

rroelke
Copy link
Member

@rroelke rroelke commented Jun 11, 2024

This small pull request is a very minor usability enhancement. The function Context::object_type returns an ObjectType for whatever it finds at a given URI.

This method currently returns Option... but not for any documented reason. And the one you would expect, that an object is not found at all, is actually an error from inside core.

Why do we return Option? Because of a possible conversion failure from the C value to the ObjectType enum. But that should be an internal error, as indicated the method this PR switches to using instead.

@rroelke rroelke requested a review from abigalekim June 11, 2024 18:54
Copy link
Contributor

@abigalekim abigalekim left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@rroelke rroelke merged commit 1b78709 into main Jun 11, 2024
2 checks passed
@rroelke rroelke deleted the rr/object-type-no-Option branch June 11, 2024 19:23
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.

2 participants