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

Generating type alias of derived enumeratedValues. #810

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- Fixed re-export of derived enumeration values

## [v0.32.0] - 2024-02-26

- Bump MSRV to 1.74
Expand Down
9 changes: 7 additions & 2 deletions src/generate/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,13 @@ pub fn fields(
if let Some(dpath) = dpath {
epath = Some(derive_enumerated_values(&mut ev, &dpath, &fpath, index)?);
// TODO: remove this hack
if let Some(epath) = epath.as_ref() {
ev = (*index.evs.get(epath).unwrap()).clone();
//if let Some(epath) = epath.as_ref() {
// ev = (*index.evs.get(epath).unwrap()).clone();
//}
// The field name is used in the enumerated_value name,
// if the enumerated_value does not have a name.
if ev.name == None {
ev.name = Some(f.name.clone());
}
} else if let Some(path) = fdpath.as_ref() {
epath = Some(
Expand Down
Loading