cedar-policy / cedar

Implementation of the Cedar Policy Language
https://www.cedarpolicy.com
Apache License 2.0
897 stars 80 forks source link

Unify the signature of `PolicySet::annotation` and `PolicySet::template_annotation` #1131

Closed shaobo-he-aws closed 3 months ago

shaobo-he-aws commented 3 months ago

Description of changes

This PR change the return type to both methods to Option<&str>. Due to the author's limited knowledge of Rust, I have to add a new function in core to get a reference to the Template. Otherwise we could let the return type be Option<SmolStr>.

Issue #, if available

1116

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

I confirm that this PR (choose one, and delete the other options):

I confirm that cedar-spec (choose one, and delete the other options):