Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support const keyword #27

Merged
merged 1 commit into from
May 12, 2023
Merged

support const keyword #27

merged 1 commit into from
May 12, 2023

Conversation

6293
Copy link
Contributor

@6293 6293 commented May 12, 2023

Closes #15

@6293 6293 requested a review from a team as a code owner May 12, 2023 06:21
@6293
Copy link
Contributor Author

6293 commented May 12, 2023

you can merge #28 first, otherwise it would be cumbersome to check the test output

@6293 6293 marked this pull request as draft May 12, 2023 07:32
@6293 6293 marked this pull request as ready for review May 12, 2023 15:09
Comment on lines +440 to +441
if let Some(value) = schema_object.const_value.take() {
*schema_object = do_normalize(value)
Copy link
Member

Choose a reason for hiding this comment

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

can we do *schema_object.const_value = Some(...) instead of overwriting the entire schema object? Very unlikely to matter since const trumps literally anything else, but I don't think we have to destroy all other properties on schema_object

Copy link
Contributor Author

@6293 6293 May 12, 2023

Choose a reason for hiding this comment

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

what we are doing here is normalizing const_value into object with each properties are constant value (lhs to rhs in #15 (comment)). so maybe we could write *schema_object.object = Some(...), but not *schema_object.const_value

Copy link
Member

Choose a reason for hiding this comment

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

whoops nvm. right.

@untitaker untitaker merged commit ff64716 into getsentry:main May 12, 2023
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.

Detect addition/removal of const
2 participants