TPE: Use value.get_as_x methods when available#2323
Conversation
value.get_as_x methods when available
john-h-kastner-aws
left a comment
There was a problem hiding this comment.
Change is good, but I feel like it could probably be more aggressive
Coverage ReportHead Commit: Base Commit: Download the full coverage report. Coverage of Added or Modified Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 75.00% Status: FAILED ❌ Details
Coverage of All Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 87.70% Status: PASSED ✅ Details
|
|
Answered in #2323 (comment):
However, now I updated the RHS matching for |
| }, | ||
| // Cannot simplify "<left-residual> && <right-residual>" or "<left-residual> && <error>" | ||
| // The latter expression could become a Residual::PartialError later. | ||
| Residual::Partial { .. } | Residual::Error(_) => { |
There was a problem hiding this comment.
using the explicit notion here instead of _ for reader clarity.
Coverage ReportHead Commit: Base Commit: Download the full coverage report. Coverage of Added or Modified Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 90.00% Status: PASSED ✅ Details
Coverage of All Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 87.73% Status: PASSED ✅ Details
|
Signed-off-by: Lucas Käldström <lucas.kaldstrom@upbound.io>
Coverage ReportHead Commit: Base Commit: Download the full coverage report. Coverage of Added or Modified Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 90.00% Status: PASSED ✅ Details
Coverage of All Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 87.73% Status: PASSED ✅ Details
|
Description of changes
Broken out from #2162
Using the
get_as_xmethods in TPE minimizes the delta to the concrete evaluator (which uses them), and gives us automatically (later) the right error types for type mismatches (which should not happen if the Residual is validated, but anyways).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):I confirm that
docs.cedarpolicy.com(choose one, and delete the other options):