fix: Replace suffix before converting to snake case#564
Merged
bors[bot] merged 1 commit intorust-embedded:masterfrom Jan 13, 2022
Merged
fix: Replace suffix before converting to snake case#564bors[bot] merged 1 commit intorust-embedded:masterfrom
bors[bot] merged 1 commit intorust-embedded:masterfrom
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Emilgardis (or someone else) soon. Please see the contribution instructions for more information. |
adamgreig
approved these changes
Jan 13, 2022
Member
adamgreig
left a comment
There was a problem hiding this comment.
Looks good, thank you!
The CI failure on nightly isn't an issue for this.
bors merge
bors bot
added a commit
that referenced
this pull request
Jan 13, 2022
564: fix: Replace suffix before converting to snake case r=adamgreig a=duskmoon314 ## Abstract In #563, we noticed that converting fields' names to snake cases before replacing the suffix caused the generated methods not to satisfy the snake case. This PR fixes this issue. ## Change Use `util::replace_suffix(&f.name, suffix).to_sanitized_snake_case()` instead of `util::replace_suffix(&f.name.to_sanitized_snake_case(), suffix)` when generating methods of fields. Co-authored-by: Campbell He <campbell.he@icloud.com>
Contributor
|
Build failed: |
Member
|
Oh, boo, since we aggregated all the CI jobs into one "CI", bors requires the nightly tests to pass as well, that's unfortunate. This needs esp-rs/xtensa-lx#14 to be merged and published, but I guess that might not be until after Rust 1.59. I'll open a PR to disable the Espressif CI in the meantime. |
bors bot
added a commit
that referenced
this pull request
Jan 13, 2022
565: Temporarily disable Espressif in CI until fixed upstream r=burrbull a=adamgreig See esp-rs/xtensa-lx#14 and #564 (comment) Co-authored-by: Adam Greig <adam@adamgreig.com>
Member
|
bors retry |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Abstract
In #563, we noticed that converting fields' names to snake cases before replacing the suffix caused the generated methods not to satisfy the snake case. This PR fixes this issue.
Change
Use
util::replace_suffix(&f.name, suffix).to_sanitized_snake_case()instead ofutil::replace_suffix(&f.name.to_sanitized_snake_case(), suffix)when generating methods of fields.