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

Adds extensive documentation for the Rust Oso crate. #1701

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xfbs
Copy link
Contributor

@xfbs xfbs commented May 5, 2023

This fills out any public documentation and adds code examples where possible. In a few places, the code was cleaned up a little bit. No logic was changed of any kind.

I have made one change, but this should be an overall improvement and is not an API change:

The Result type that Oso exposes was changed slightly from

type Result<T> = std::result::Result<T, OsoError>;

to

type Result<T, E = OsoError> = std::result::Result<T, E>;

This makes it more useful: now you can write Result<String> and it will mean Result<String, OsoError>, but you can still manually override the error type by writing Result<String, IoError>. The same approach is taken by anyhow::Result. Since this Result type is just an alias, and because this does not affect existing usages (only relaxes the restriction, such that more parameters can be specified), it does not consitute a breaking change and does not need to be reflected by a version bump.

I'm not sure if this needs to go into the changelog, if so feel free to add it.

This fills out any public documentation and adds code examples where
possible. In a few places, the code was cleaned up a little bit.
@github-actions
Copy link

github-actions bot commented May 5, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

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.

None yet

1 participant