Skip to content

Conversation

cdisselkoen
Copy link
Contributor

Description of changes

Another refactor relating to the internal type Node.

I don't think Node::as_inner_pair() was helping. Replaced it with calls to as_inner() and accessing self.loc directly, which I think is clearer. (In some places, where there are more than one SourceSpans involved, it makes it super clear which span is being used.)

Issue #, if available

Checklist for requesting a review

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

  • 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):

  • 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):

  • Does not require updates because my change does not impact the Cedar Dafny model or DRT infrastructure.

Disclaimer

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

errs: &mut ParseErrors,
) -> Option<ast::Template> {
let (maybe_policy, src) = self.as_inner_pair();
let maybe_policy = self.as_inner();
Copy link
Contributor

Choose a reason for hiding this comment

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

I might go a step further and inline this with let policy = ... and do the same for similar uses in other functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Planning on that as a followup

@cdisselkoen cdisselkoen merged commit 0247e10 into main Dec 15, 2023
@cdisselkoen cdisselkoen deleted the cdisselkoen/remove-node-method branch December 15, 2023 15:22
@cdisselkoen cdisselkoen mentioned this pull request Dec 15, 2023
3 tasks
shaobo-he-aws pushed a commit that referenced this pull request May 20, 2025
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.

3 participants