You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice to make this more readable by using the lowercase term in the format, such as #[display("{lowercase}:{0}")] or #[display("{}:{0}", lowercase)]. A drawback of the former is ambiguity if the variant contains a lowercase field (positional format args don't appear to be accepted currently), so the latter is likely the preferred form.
I see. Not sure what would be the best way not to make {lowercase} literal not to conflict with variable names which may come from associated enum data or structure fields.
I am planning improvements to Display derivation, like support for vectors/colection types with some separator etc, so will keep this in mind during the design.
I have an
Display
ed enum with a custom format on each variant, like this:It'd be nice to make this more readable by using the
lowercase
term in the format, such as#[display("{lowercase}:{0}")]
or#[display("{}:{0}", lowercase)]
. A drawback of the former is ambiguity if the variant contains alowercase
field (positional format args don't appear to be accepted currently), so the latter is likely the preferred form.Even better would be this:
The text was updated successfully, but these errors were encountered: