Add #[nu_value(rename = "...")] as helper attribute on members for derive macros (#13761)

# Description

This PR allows the helper attribute `nu_value(rename = "...")` to be
used on struct fields and enum variants. This allows renaming keys and
variants just like [`#[serde(rename =
"name")]`](https://serde.rs/field-attrs.html#rename). This has no
singular variants for `IntoValue` or `FromValue`, both need to use the
same (but I think this shouldn't be an issue for now).

# User-Facing Changes

Users of the derive macros `IntoValue` and `FromValue` may now use
`#[nu_value(rename = "...")]` to rename single fields, but no already
existing code will break.
This commit is contained in:
Piepmatz
2024-09-04 11:27:21 +02:00
committed by GitHub
parent fa4f9b083e
commit ebe42241fe
11 changed files with 599 additions and 210 deletions

View File

@ -36,6 +36,7 @@ mod case;
mod error;
mod from;
mod into;
mod names;
#[cfg(test)]
mod tests;