Improve rustdoc coverage and enforce missing_docs lint#13
Merged
Conversation
Add #![warn(missing_docs)] to prevent documentation regressions. Add Quick Start section with PolicyBuilder example, standalone PolicyBuilder doc example, RbacPolicy usage example, and EvalTrace/AccessEvaluation helper documentation. Document all previously undocumented public items including CombineOp variants, PolicyEvalResult fields, Effect variants, RebacPolicy fields, and all constructor methods.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the crate’s public API documentation and rustdoc quality by enabling missing_docs warnings and adding/expanding examples across core policy and tracing types, helping prevent future documentation regressions.
Changes:
- Enabled
#![warn(missing_docs)]at the crate level. - Added a new module-level “Quick Start” section and expanded/added doc examples for
PolicyBuilder,RbacPolicy,AccessEvaluation, andEvalTrace. - Filled in missing rustdoc on remaining public enums/fields/methods (e.g.,
CombineOp,Effect,PolicyEvalResult,RebacPolicy, and policy constructors).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address review feedback: the EvalTrace example now correctly demonstrates both the empty-trace fallback and a populated trace using with_root(). Remove unused uuid::Uuid import from the to_result doc example.
This was referenced Feb 17, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#![warn(missing_docs)]to prevent documentation regressionsPolicyBuilderusage up front, before the longer manualimpl PolicyexamplePolicyBuilderdemonstratingsubjects,actions,resources, andwhenpredicatesRbacPolicy(was the only built-in policy without one)EvalTracestruct and all its methods,AccessEvaluation::display_trace(), and add a code example forAccessEvaluation::to_result()CombineOpvariants,PolicyEvalResultfields,Effectvariants,RebacPolicyfields, and constructor methods on all policy typesTest plan
cargo fmt --all— no changescargo clippy --all-targets --all-features -- -D warnings— zero warningscargo doc --no-deps— zero warnings (was 26 before)cargo test --all-targets --all-features— all 53 tests pass (including new doc tests)