Skip to content

Get the raw format from serde::format_description! #515

Closed Answered by jhpratt
Nohac asked this question in Question
Discussion options

You must be logged in to vote

While the format description string is duplicated, the actual duplication in generated code is insignificant, as consts are effectively values that are inlined wherever they're used. With regard to exposing the value, this is doable. It's already present, just scoped to the generated module. I'll think about it some.

Also, slightly unrelated question, but is it possible to define "optional" time components? In the example above, I want the .[subsecond digits:3] to be optional.

Not currently. It is tracked in #428, where there is no update.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Nohac
Comment options

@jhpratt
Comment options

@jhpratt
Comment options

@jhpratt
Comment options

@jhpratt
Comment options

Answer selected by Nohac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants