Closed
Conversation
b68be3e to
b4a40d8
Compare
This adds a new rename-all annotation which allows setting a specific
prefix to all fields. For example:
```rust
/// cbindgen:rename-all=prefix:ERR_
enum Error {
Bad = 0,
VeryBad = 1
}
```
While in principle this can be added to the config file, it's primarily
useful for overrides on a case-by-case basis.
b4a40d8 to
3a3928d
Compare
Contributor
Author
|
Alternatively (and perhaps preferably) this could be a separate option which is applied after the normal rename rule so you can both rename and add a prefix (which could be applied after prefix-with-name or exclusive with it). |
facebook-github-bot
pushed a commit
to facebookexperimental/rust-shed
that referenced
this pull request
Oct 4, 2024
Summary: [Fix an upstream bug](mozilla/cbindgen#1006) and [add ability to put arbitrary prefix on field names](mozilla/cbindgen#1007). Reviewed By: jasonwhite Differential Revision: D63878067 fbshipit-source-id: 16a35ed1fa2adc4c9211fc6f6332f0be7dbf4f56
facebook-github-bot
pushed a commit
to facebook/sapling
that referenced
this pull request
Oct 4, 2024
Summary: [Fix an upstream bug](mozilla/cbindgen#1006) and [add ability to put arbitrary prefix on field names](mozilla/cbindgen#1007). Reviewed By: jasonwhite Differential Revision: D63878067 fbshipit-source-id: 16a35ed1fa2adc4c9211fc6f6332f0be7dbf4f56
facebook-github-bot
pushed a commit
to facebook/hhvm
that referenced
this pull request
Oct 4, 2024
Summary: [Fix an upstream bug](mozilla/cbindgen#1006) and [add ability to put arbitrary prefix on field names](mozilla/cbindgen#1007). Reviewed By: jasonwhite Differential Revision: D63878067 fbshipit-source-id: 16a35ed1fa2adc4c9211fc6f6332f0be7dbf4f56
emilio
approved these changes
Oct 27, 2024
| .annotations | ||
| .parse_atom::<RenameRule>("rename-all") | ||
| .unwrap_or(config.structure.rename_fields); | ||
| .unwrap_or(config.structure.rename_fields.clone()); |
Collaborator
There was a problem hiding this comment.
Maybe avoid these clones by:
let rules = self.annotations.parse_atom::<>();
let rules = rules.as_ref().unwrap_or(&config.structure.rename_fields);But fine either way.
Merged
facebook-github-bot
pushed a commit
to facebook/dotslash
that referenced
this pull request
Oct 29, 2024
Summary: PRs mozilla/cbindgen#1006 mozilla/cbindgen#1007 were accepted, so update patch to upstream git repo until next release is cut. Also bump `syn` to match cbindgen. Reviewed By: dtolnay Differential Revision: D65079945 fbshipit-source-id: 5b9f0467150d7cf81f5a9df0bb4d0c1309e67e1b
facebook-github-bot
pushed a commit
to facebookexperimental/rust-shed
that referenced
this pull request
Oct 29, 2024
Summary: PRs mozilla/cbindgen#1006 mozilla/cbindgen#1007 were accepted, so update patch to upstream git repo until next release is cut. Also bump `syn` to match cbindgen. Reviewed By: dtolnay Differential Revision: D65079945 fbshipit-source-id: 5b9f0467150d7cf81f5a9df0bb4d0c1309e67e1b
facebook-github-bot
pushed a commit
to facebook/sapling
that referenced
this pull request
Oct 29, 2024
Summary: PRs mozilla/cbindgen#1006 mozilla/cbindgen#1007 were accepted, so update patch to upstream git repo until next release is cut. Also bump `syn` to match cbindgen. Reviewed By: dtolnay Differential Revision: D65079945 fbshipit-source-id: 5b9f0467150d7cf81f5a9df0bb4d0c1309e67e1b
facebook-github-bot
pushed a commit
to facebookincubator/reindeer
that referenced
this pull request
Oct 29, 2024
Summary: PRs mozilla/cbindgen#1006 mozilla/cbindgen#1007 were accepted, so update patch to upstream git repo until next release is cut. Also bump `syn` to match cbindgen. Reviewed By: dtolnay Differential Revision: D65079945 fbshipit-source-id: 5b9f0467150d7cf81f5a9df0bb4d0c1309e67e1b
facebook-github-bot
pushed a commit
to facebook/hhvm
that referenced
this pull request
Oct 29, 2024
Summary: PRs mozilla/cbindgen#1006 mozilla/cbindgen#1007 were accepted, so update patch to upstream git repo until next release is cut. Also bump `syn` to match cbindgen. Reviewed By: dtolnay Differential Revision: D65079945 fbshipit-source-id: 5b9f0467150d7cf81f5a9df0bb4d0c1309e67e1b
facebook-github-bot
pushed a commit
to facebookexperimental/rust-shed
that referenced
this pull request
Apr 8, 2025
Summary: as titled, upgrade to 0.28 (https://github.com/mozilla/cbindgen/blob/master/Cargo.toml), which included previous patched PR * mozilla/cbindgen#1006 * mozilla/cbindgen#1007 patch a new PR that includes another fix to unblock our work (D72418369) * mozilla/cbindgen#1063 Reviewed By: chaos5958 Differential Revision: D72474788 fbshipit-source-id: b839aac0561c25eadffb01e5ad0699578cd51db2
facebook-github-bot
pushed a commit
to facebook/sapling
that referenced
this pull request
Apr 8, 2025
Summary: as titled, upgrade to 0.28 (https://github.com/mozilla/cbindgen/blob/master/Cargo.toml), which included previous patched PR * mozilla/cbindgen#1006 * mozilla/cbindgen#1007 patch a new PR that includes another fix to unblock our work (D72418369) * mozilla/cbindgen#1063 Reviewed By: chaos5958 Differential Revision: D72474788 fbshipit-source-id: b839aac0561c25eadffb01e5ad0699578cd51db2
facebook-github-bot
pushed a commit
to facebook/hhvm
that referenced
this pull request
Apr 8, 2025
Summary: as titled, upgrade to 0.28 (https://github.com/mozilla/cbindgen/blob/master/Cargo.toml), which included previous patched PR * mozilla/cbindgen#1006 * mozilla/cbindgen#1007 patch a new PR that includes another fix to unblock our work (D72418369) * mozilla/cbindgen#1063 Reviewed By: chaos5958 Differential Revision: D72474788 fbshipit-source-id: b839aac0561c25eadffb01e5ad0699578cd51db2
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.
This adds a new rename-all annotation which allows setting a specific prefix to all fields. For example:
While in principle this can be added to the config file, it's primarily useful for overrides on a case-by-case basis.