nushell/crates/nu-derive-value/src
Piepmatz ebe42241fe
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.
2024-09-04 11:27:21 +02:00
..
attributes.rs Add #[nu_value(rename = "...")] as helper attribute on members for derive macros (#13761) 2024-09-04 11:27:21 +02:00
case.rs Add #[nu_value(rename = "...")] as helper attribute on members for derive macros (#13761) 2024-09-04 11:27:21 +02:00
error.rs Add #[nu_value(rename = "...")] as helper attribute on members for derive macros (#13761) 2024-09-04 11:27:21 +02:00
from.rs Add #[nu_value(rename = "...")] as helper attribute on members for derive macros (#13761) 2024-09-04 11:27:21 +02:00
into.rs Add #[nu_value(rename = "...")] as helper attribute on members for derive macros (#13761) 2024-09-04 11:27:21 +02:00
lib.rs Add #[nu_value(rename = "...")] as helper attribute on members for derive macros (#13761) 2024-09-04 11:27:21 +02:00
names.rs Add #[nu_value(rename = "...")] as helper attribute on members for derive macros (#13761) 2024-09-04 11:27:21 +02:00
tests.rs Add #[nu_value(rename = "...")] as helper attribute on members for derive macros (#13761) 2024-09-04 11:27:21 +02:00