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

Further simplification enabled by chained conversions #11682

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented Nov 27, 2024

Pull Request Description

Some simplification enabled by the refactor in #11671. Inspired by review from @JaroslavTulach.

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@kazcw kazcw added the CI: No changelog needed Do not require a changelog entry for this PR. label Nov 27, 2024
@kazcw kazcw self-assigned this Nov 27, 2024
@kazcw kazcw marked this pull request as ready for review November 27, 2024 14:32
@@ -284,34 +281,13 @@ pub enum Precedence {
Negation,
Application,
Annotation,
/// A value that is higher than the precedence of any operator.
Max,
// NOTE: The highest value must not exceed 0x7e--see usage of `into_u8`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I see only one usage of into_u8: in ModifiedPrecedence::new; there's no docs, and I don't know why 0x7f is not allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's unlikely we would ever want to use high numeric values for these, but out of an abundance of caution I put a note here to make sure that anyone considering doing so knows what that could affect. If they are really determined to make that sort of change, the reference to into_u8 points them in the right direction to find out why they can't use 0x7f.

Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

Have I provided a useful review for Rust code!?

@farmaazon
Copy link
Contributor

Have I provided a useful review for Rust code!?

I assume what you want to say is that you don't need to be owner of rust parser code.

You were added long ago c525b20 by @kazcw ; I guess you may freely unsubscribe from it.

@kazcw
Copy link
Contributor Author

kazcw commented Dec 3, 2024

Have I provided a useful review for Rust code!?

😆 This isn't the first time you've made some good points--at this point you're a bona fide Rustacean. As a Rust developer, when you have to work in Java do you miss the zero-cost abstractions?

@kazcw kazcw added the CI: Ready to merge This PR is eligible for automatic merge label Dec 3, 2024
@mergify mergify bot merged commit 2863cc5 into develop Dec 3, 2024
37 of 40 checks passed
@mergify mergify bot deleted the wip/kw/chained-conversions branch December 3, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants