Skip to content

Support mappings for rename - #185

Merged
jcrist merged 1 commit into
mainfrom
rename-mapping
Sep 13, 2022
Merged

Support mappings for rename#185
jcrist merged 1 commit into
mainfrom
rename-mapping

Conversation

@jcrist

@jcrist jcrist commented Sep 13, 2022

Copy link
Copy Markdown
Member

This adds support for passing either a Mapping[str, str] or a callable of signature Callable[[str], Optional[str]] (the Optional is the new bit) to rename. This makes it easier to only rename a few fields in a struct, as the rename function doesn't need to handle every field.

Simplifies the use case described in #182.

This adds support for passing either a `Mapping[str, str]` or a callable
of signature `Callable[[str], Optional[str]]` (the `Optional` is the new
bit) to `rename`. This makes it easier to only rename a few fields in a
struct, as the rename function doesn't need to handle every field.
@jcrist
jcrist merged commit 82bc51b into main Sep 13, 2022
@jcrist
jcrist deleted the rename-mapping branch September 13, 2022 01:52
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.

1 participant