Some pure refactors (no functional change) in types.rs. I had these in service of RFC 68 code, but they are separable so I thought it would be useful to review them separately and thus reduce the size of the coming RFC 68 PR.
Brief summary of the changes:
Adding and improving comments
Rename .all_attrs() to .all_known_attrs() for clarity
Pulling some existing code into dedicated helper functions AttributeType::is_subtype() and AttributeType::least_upper_bound()
Return a reference rather than an owned type in one place
Issue #, if available
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
[x] A change "invisible" to users (e.g., documentation, changes to "internal" crates like cedar-policy-core, cedar-validator, etc.)
I confirm that this PR (choose one, and delete the other options):
[x] Does not update the CHANGELOG because my change does not significantly impact released code.
I confirm that cedar-spec (choose one, and delete the other options):
[x] Does not require updates because my change does not impact the Cedar formal model or DRT infrastructure.
Description of changes
Some pure refactors (no functional change) in
types.rs
. I had these in service of RFC 68 code, but they are separable so I thought it would be useful to review them separately and thus reduce the size of the coming RFC 68 PR.Brief summary of the changes:
.all_attrs()
to.all_known_attrs()
for clarityAttributeType::is_subtype()
andAttributeType::least_upper_bound()
Issue #, if available
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
cedar-policy-core
,cedar-validator
, etc.)I confirm that this PR (choose one, and delete the other options):
I confirm that
cedar-spec
(choose one, and delete the other options):