Skip to content

Combining DisplayFromStr and Uppercase #419

Answered by jonasbb
ctron asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, that is currently not possible. The DisplayFromStr does not allow any modification of the serialized string. I don't think it necessarily makes sense to add support for that in this crate. It is simple enough to create your own custom MyDisplayFromStr type with any string modification operation you need, instead of a limited pre-defined set. You could also define a generic type like MyDisplayFromStr<Uppercase> if you need that flexibility. Uppercasing a String is also so complicated that it has different meanings, so picking one probably doesn't work too well.

Uppercase cannot be combined with any arbitrary other type. The types in the format module are only needed if some other type …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jonasbb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants