mirror of
https://github.com/danog/strum.git
synced 2024-12-04 10:28:13 +01:00
e6a9bf08c4
The default attribute on a tuple like variant now causes the to_string and display format to use the value of the tuple rather than the name of the variant. E.g. Color::Green("lime").to_string() will equal "lime" not "Green" Fixes: how to round trip Display and EnumString with default="true" #86 BREAKING CHANGE This changes how Display and ToString cause the following to renders: ```rust #[strum(default)] Green(String) ``` To maintain the previous behavior (use the variant name): ```rust #[strum(default, to_string("Green"))] Green(String) ``` |
||
---|---|---|
.. | ||
as_ref_no_strum.rs | ||
as_ref_str.rs | ||
display.rs | ||
enum_count.rs | ||
enum_discriminants.rs | ||
enum_iter.rs | ||
enum_message.rs | ||
enum_props.rs | ||
enum_variant_names.rs | ||
from_repr.rs | ||
from_str.rs | ||
phf.rs | ||
serialize_all.rs | ||
to_string.rs |